Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have some domains that send commercial mailings despite us asking to be removed from their listings.

I want to configure Postfix to reject all email from certain email domains.

How do I configure this in postfix?

share|improve this question

1 Answer 1

Use smtpd_sender_restrictions as follows:


main.cf

smtpd_sender_restrictions =
        # Reject some domains because they send annoying spam
        check_sender_access hash:/etc/postfix/sender_access
        # Other useful things to do:
        warn_if_reject reject_non_fqdn_sender
        reject_unknown_sender_domain
        # Default PERMIT

/etc/postfix/sender_access

# annoying spammer domains
businessleadsonlinemail.com     REJECT
527media.com                    REJECT
aweberer.com                    REJECT
pathcom.com                     REJECT

Don't forget to postmap your new access database!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.