We have creates an smtp server for our webapps.

This server runs Under Ubuntu with Postfix and Opendkim. We have 40 domains with 40 DKIM keys. My config is the same as described in this blog post

It works just fine.

My problem : If developers create an email with a domain my server doesn't know in the trusted list, it will send it, and block the mail in between 2 and 3 minutes.

Can I do something to make postfix reject untrusted mails immediately?

I've tried in opendkim conf ADSPNoSuchDomain=true and ADSPAction=reject. My mails are rejected, but still waiting in the queue for 2-3 minutes.

I've found nothing usable in Postfix to block these domains.


I've found how to reject untrusted domains from my local network :

1) In /etc/postfix/main.cf add the line :

smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access, reject

2) In /etc/postfix create the file sender_access and copy/paste all permitted domains.

3) Execute the command postmap sender_access to create a sender_access.db file.

4) Restart Postfix.

Now if I want to send a mail from my local network with a domain that doesn't exist in the sender_access.db file, Postfix rejects the mail immediately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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