Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to do sender address filtering within postfix itself? I want to block email where the sender and recipient are both except in the case that the email was sent locally.

I would rather not have to install (bloated) anti-spam software just for one filter.

share|improve this question
up vote 4 down vote accepted

Yes, you can do this with a policy server. Standard smtpd_receipient_restrictions and smtpd_sender_restrictions can't do this exactly - they can do it separately and you could defer from one to the next but it wouldn't be reliable.

Policy server is the best way to go. The page I linked to even shows an example policy server written in Perl.

share|improve this answer

Your Answer


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.