Greetings!

I implemented a rule with transport_maps to block all public email delivery 
except whitelisted domains as below:

/etc/postfix/main.cf
=================
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]


The logs show the transport_map takes preference over the aliases map. The DNS 
domain of $myhostname is prd.mycompany.com, which is a subdomain of 
mycompany.com.

Jun 17 10:33:39 mxserver postfix/pickup[1128]: 76067F81FE: uid=0 from=<root>
Jun 17 10:33:39 mxserver postfix/cleanup[1208]: 76067F81FE: 
message-id=<[email protected]>
Jun 17 10:33:39 mxserver postfix/qmgr[1129]: 76067F81FE: 
from=<[email protected]>, size=797, nrcpt=1 (queue active)
Jun 17 10:33:39 mxserver postfix/error[1210]: 76067F81FE: 
to=<[email protected]>, orig_to=<root>, relay=none, delay=0.01, 
delays=0.01/0/0/0, dsn=5.1.2, status=bounced (recipient domains not allowed)
Jun 17 10:33:39 mxserver postfix/cleanup[1208]: 784AAF8200: 
message-id=<[email protected]>
Jun 17 10:33:39 mxserver postfix/bounce[1211]: 76067F81FE: sender non-delivery 
notification: 784AAF8200
Jun 17 10:33:39 mxserver postfix/qmgr[1129]: 784AAF8200: from=<>, size=2766, 
nrcpt=1 (queue active)
Jun 17 10:33:39 mxserver postfix/qmgr[1129]: 76067F81FE: removed
Jun 17 10:33:39 mxserver postfix/error[1210]: 784AAF8200: 
to=<[email protected]>, relay=none, delay=0.01, delays=0/0/0/0, 
dsn=5.1.2, status=bounced (recipient domains not allowed)
Jun 17 10:33:39 mxserver postfix/qmgr[1129]: 784AAF8200: removed

Is there any way to make the alias map take preference to the transport map?

Thanks,
Steve ‎
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