Pages

Sunday, June 10, 2012

Block a specific email address in postfix

Sometimes we need to block a specific email address in postfix. Here is how to do that.

Add the following line in main.cf

smtpd_sender_restrictions = reject_unknown_sender_domain,check_sender_access hash:/etc/postfix/access


Now add the address you want to block in access file like following.

noreply@test.com          REJECT

After adding the address postmap the access file.

postmap /etc/postfix/access


Now your MX will not receive any mail from the address "noreply@test.com"




No comments:

Post a Comment