On Sat, Jun 22, 2013 at 12:13:16PM +0100, Craig R. Skinner wrote:
> > >main.cf:
> > >myorigin = $mydomain
> > >mydestination = localhost.$mydomain
Notice the exact form of the above (IIRC that was my suggestion).
> > No. If the destination you use in virtual_alias_maps is @localhost,
> > then THAT must be in mydestination.
> > Postfix is quite literal.
> >
> > mydestination = localhost
> > append_dot_mydomain = no
Whoever said that does not know what they are talking about. With
the default of "append_dot_mydomain = yes", Postfix will replace
"user@localhost" with "user@localhost.$mydomain" before performing
recursive lookups with virtual_alias_maps.
> > Or, if you wish to follow Victor's advice, qualify all aliases with
> > "@localhost.$mydomain" instead.
No, that can't be done literally, one would have to replace
"$mydomain" with the actual value. To quote Dr. Seuss: I meant
what I said and I said what I meant.
> Superbly simple config Jeroen, unfortunately it doesn't work for me -
> yet.
>
> main.cf:
> myorigin = $mydomain
> mydestination = localhost
mydestination = localhost.$mydomain
> append_dot_mydomain = no
append_dot_mydomain = yes
> remote_header_rewrite_domain = sender.domain.incomplete
remote_header_rewrite_domain = address.invalid
The ".invalid" TLD is IANA reserved for invalid domain names.
If these aliases are to be effective the RHS needs to be in a valid
domain, your choices are "localhost" or "example.com". The former
will perform local(8) delivery directly without generating a new
queued message with the expanded recipients. The latter will do
indirect (new queue file) delivery because example.com is not in
mydestination.
> virtual_alias_maps.map:
> # accept mail for postmaster/abuse@[ip.add.ress.es]
> postmaster postmaster
Never leave RHS domain unset in virtual_alias_maps. Replace the
RHS with postmaster@localhost (which punts the mail to local(8)
for aliases(5) expansion) or with the full addresses of users
receiving postmaster mail. The LHS can only be left unqualified
if the virtual alias domain is equal to $myorigin. Otherwise,
it too MUST be an FQDN.
Thus, either:
# Actual expansion in local(8) aliases(5). Not recommended.
#
[email protected] postmaster@localhost
or:
# Actual expansion in local(8) aliases(5). Preferred:
#
[email protected] [email protected], [email protected], ...
> abuse postmaster
Here:
[email protected] [email protected]
> [email protected] hostmaster
Same as postmaster!
> [email protected] acct145
[email protected] [email protected]
> [email protected] jb4356
[email protected] jb4356@localhost
> [email protected] jb8921
[email protected] jb8921@localhost
Use virtual(5) for ALL address -> address mappings, with only
addresses that represent final mailboxes listed as account@localhost.
Use aliases(5) sparingly, only for "|command" aliases (try to avoid
these anyway) or ":include:" lists.
The aliases(5) file is a Sendmail compatibility feature, whose
features are best remapped onto virtual(5) (address to address
mappings controlled by the administrator) and .forward files (own
address to address or command mappings possibly controlled by shell
users).
--
Viktor.