1

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.

2

1 Answer 1

3

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:

example.com REJECT
example.net REJECT you're not me!
example.org REJECT go away!

As you see, you can provide custom errors too.

1
  • 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=<bounce-mc.us10_38474169.191501-me=example.com@mail101.somehost.net> to=<[email protected]>. Clearly this is not what you intended by the addition of this rule. Maybe the rule needs to be /^example.com$/ but then the spammer can just append some characters to it...
    – user7835
    May 4, 2016 at 12:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .