Domain – Postfix – how to block emails sending out to a particular domain

domainemail-serverpostfix

I am having Postfix installed mailserver and I am using that server for legitimate purpose only.

I need to block some outgoing emails for a particular blacklisted domain. Is there anyway to do through the configurations ?

Your help is greatly appreciated.

Thanks in advance
Karthick

Best Answer

A closer look at the basic access controls available should help you out; just specify the appropriate access map in smtpd_recipient_restrictions that denies access to those domains:

smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/blacklisted_domains, permit_mynetworks, reject_unauth_destination, permit

and in /etc/postfix/blacklisted_domains:

bad.domain1    REJECT
bad.domain2    REJECT
baduser@bad.domain3    REJECT

Don't forget to postmap that file.

Related Topic