On Thursday, June 04, 2009 at 22:00 CEST,
     Tim Legg <[email protected]> wrote:

> Thanks for the tip and the links you provided me.  The Standard
> Configuration Readme provided a lot of insight!
> 
> This is how my main.cf is set up and seems to work, but it is not
> correct according to what I read earlier.
> 
> /etc/postfix/main.cf
> mydestination = example1.com, genex.example1.com, localhost.example1.com, 
> localhost
> virtual_alias_domains =  example2.org, localhost.example2.org 
> genex.example2.org
> virtual_alias_maps = hash:/etc/postfix/virtual
> 
> /etc/postfix/virtual
> [email protected]    legg
> [email protected]    legg
> 
> 
> So I changed the main.cf to this
> /etc/postfix/main.cf
> mydestination = localhost
> virtual_alias_domains =  example1.com, genex.example1.com, 
> localhost.example1.com, example2.org, localhost.example2.org 
> genex.example2.org
> virtual_alias_maps = hash:/etc/postfix/virtual
> 
> Upon instating these changes, mail to [email protected] gets returned
> back.  User unknown in virtual alias table.

That's because you're not really rewriting the address. If a recipient
address in the right-hand side of a virtual alias table is unqualified
(i.e. a bare username like in your case) it won't implicitly be
delivered locally. Instead the address will be qualified with $myorigin,
which in your case probably is example1.com. Hence [email protected]
will be rewritten to itself, and Postfix will stop the recursion and say
"User unknown in virtual alias table". To make sure the addresses are
delivered locally, make sure to put fully-qualified addresses in the
right-hand side, with that domain name listed in mydestination.

-- 
Magnus Bäck
[email protected]

Reply via email to