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

I have Postfix configured with a few domains, delivering to Dovecot locally.

I’ve noticed some interesting spam that comes in, purporting to be from an address at one of those domains, but that address does not exist.

How can I configure Postfix to drop those emails? Real email from this domain a. originates from the same server it is being delivered to, and b. is DKIM signed.

share|improve this question — ? – poige Oct 31 '12 at 18:49
...or better setup SPF in your postfix configuration – Kamil Šrot Oct 31 '12 at 19:14

You can prevent people using your own domains in MAIL FROM commands by putting them in a check_sender_access map after you accept mail from mynetworks and submission (SASL):

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_sender_access hash:/etc/postfix/my_domains, reject_unauth_destination

And in /etc/postfix/my_domains: REJECT REJECT you're not me! REJECT go away!

As you see, you can provide custom errors too.

share|improve this answer
The problem with this approach seems to be that some mailing lists encode the TO address in the FROM address. So you will get, for example, Sender address rejected: Access denied; from=<> to=<>. Clearly this is not what you intended by the addition of this rule. Maybe the rule needs to be /^$/ but then the spammer can just append some characters to it... – g33kz0r May 4 at 12:10

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.