On Thu, Feb 26, 2015 at 02:08:53AM +0100, Xylia Cipriano wrote:
> I have setup Postfix with virtual users and MySQL. I have a few domains and
> they all work great. I also added an alias "[email protected]" and sending a
> mail to the local root account results in a message in the forwarding inbox
> (perfect).
>
> However, when sending mail to the local postmaster account, an error occurs
> (unknown user). The aliases file contains "postmaster: root", and I assumed
> the following chain to work "postmater (local) --> root (local) -->
> [email protected] (virtual)". This is not the case.
An unavoidable compromise is made in Postfix to maintain approximate
compatibility with Sendmail aliases(5) semantics. Specifically,
when an alias resolves to a recipient whose address class is "local"
(domain matches $mydestination), that address is assumed local and
does not go through virtual alias rewriting.
> How is the correct way to forward local e-mail to a virtual user? I like the
> previously mentioned idea, that the local root account is virtually aliases,
> and therefore the chain postmaster --> root --> virtual would work. Is this
> possible?
Put an explicit domain on the RHS of the alias, making sure that the
domain in question is a virtual alias domain, or in any case not
listed in mydestination.
aliases:
postmaster: [email protected]
virtual:
[email protected] [email protected]
[email protected] [email protected]
Simpler however is to avoid local aliases(5) entirely except for
mailing lists with owner aliases and ":include:" member address
files (these are best handled in aliases(5) everything else is
better handled entirely in virtual(5)).
virtual:
[email protected] [email protected]
[email protected] [email protected]
I also tend to keep mydestination almost empty, putting only
synthetic domains there (local.invalid or similar), and explicitly
rewrite selected addresses for local delivery. In particular, I
try to make sure that $myorigin is not one of the "local" domains.
--
Viktor.