On Mon, Jun 24, 2013 at 03:12:24PM +0100, Craig R. Skinner wrote: > main.cf: > myorigin = $mydomain # example.com > mydestination = localhost, localhost.$mydomain
Here we see that $myorigin (nor $mydomain) is listed in $mydestination. > However, aliases seems to be totally ignored. > > When I move these from virtual_alias_maps back to aliases, > mail to those convential aliases bounces: > > aliases: > root: admin-acct I don't know if this was mentioned upthread or not, but you seem to be making a common, wrong assumption about the meaning of an unqualified address localpart, e.g., "admin-acct" in this example. You're probably thinking that means "deliver to the Unix user 'admin-acct'", when in fact it means "deliver to the address 'admin-acct@$myorigin'". If $myorigin (which you set to $mydomain) is not listed in $mydestination, local(8) delivery is not used. Likewise, aliases(5) ($alias_maps) are only consulted for addresses where the domain is listed in $mydestination. For you, that's only localpart@localhost.$mydomain (or "localpart@localhost" also if you followed Jeroen's suggestion of "append_dot_mydomain=no".) OTOH virtual(5) ($virtual_alias_maps) mapping is applied to all addresses, regardless of class. > MAILER-DAEMON: postmaster > bin: root > daemon: root > named: hostmaster > nobody: root > uucp: root > www: root > ftp-bugs: root > _postfix: postmaster > manager: root > dumper: root > operator: root Generally I'd say it's a best practice to always specify fully-qualified addresses on the RHS of $alias_maps and $virtual_alias_maps. Then you always know where it's going (offer void where taxed or prohibited, or where the user fails to understand Postfix mail routing.) > $ uptime | mail -s uptime root Here you have deliberately used an unqualified localpart as if it was an email address. > Jun 24 14:37:25 server1 postfix/pickup[29745]: C15E367DC: uid=7432 > from=<admin-acct> > Jun 24 14:37:25 server1 postfix/cleanup[20891]: C15E367DC: > message-id=<20130624133725.c15e36...@server1.example.com> > Jun 24 14:37:25 server1 postfix/qmgr[32379]: C15E367DC: > from=<server.ad...@example.com>, size=389, nrcpt=1 (queue active) (Inconsistent munging, or the sender was rewritten from admin-acct@$myorigin to server.ad...@example.com.) > Jun 24 14:37:25 server1 postfix/error[22953]: C15E367DC: > to=<r...@example.com>, orig_to=<root>, relay=none, delay=0.26, > delays=0.14/0.06/0/0.06, dsn=5.0.0, status=bounced (User unknown in virtual > alias table) Postfix has appended @$myorigin as documented. example.com is in $virtual_alias_domains (as you showed), but r...@example.com either: 1. is not listed in $virtual_alias_maps; or 2. does not resolve to an address which is NOT in $virtual_alias_domains As mentioned above, since example.com is NOT in $mydestination (and you must not list the same domain in more than one address class definition), $alias_maps are not consulted. > From what I'm still seeing, aliases is not referenced when the > machine's domain name is virtual. Is this significant? Um, yes, that's more or less what I have been saying. :) References which might be of interest: http://www.postfix.org/ADDRESS_CLASS_README.html http://www.postfix.org/postconf.5.html#append_at_myorigin -- http://rob0.nodns4.us/ -- system administration and consulting Offlist GMX mail is seen only if "/dev/rob0" is in the Subject: