Virtual alias sounds like a better idea. I just implemented a workaround 
solution by adding an extra line below to white list all subdomain of 
mycompany.com at /etc/postfix/transport:

‎mycompany.com :
‎ .mycompany.com :

Will try it out. Thanks a lot.

Steve

Sent from my BlackBerry 10 smartphone on the Bell network.
  Original Message
From: Viktor Dukhovni
Sent: Thursday, June 18, 2015 5:54 PM
To: [email protected]
Reply To: [email protected]
Subject: Re: preference transport_maps and alias_maps


On Thu, Jun 18, 2015 at 07:53:58PM +0000, Steve Zeng wrote:

> transport_maps = hash:/etc/postfix/transport
>
> /etc/postfix/transport
> ==================
> trustedcompany.com :
> mycompany.com :
> * error:5.1.2 recipient domains not allowed
>
> It works quite well until it is reported that the logwatch emails are
> blocked. The logwatch email is sent to root user at localhost, which is
> an aliases defined at /etc/aliases.
>
>
> /etc/aliases
> ==================
> root: [email protected]
>
> Is there any way to make the alias map take preference to the transport map?

Yes, if you ask the right question.

While local aliases(5) happen after transport selection, virtual(5)
aliases happen before transport selection.  So turn that into a
virtual(5) alias and you get what you wanted.

--
        Viktor.
NOTICE: This email message is for the sole use of the addressee named above and 
may contain confidential information.
Any unauthorized review, use, disclosure, distribution or duplication of this 
message or any attachments is expressly prohibited.
If you are not the intended recipient, please contact the sender by reply email 
and destroy all copies and backups of the original message.

Reply via email to