Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

So for reasons unknown, I need to block emails To or From a certain email address.

I don't care what is in the emails, but I would like a notification email sent to another address if possible, however this is not vital.

Details: Kernel 2.8.18
Dovecot - 1.0.rc15
Postfix - 2.3.3



Ok so I've added

smtpd_client_restrictions = check_client_access hash:/etc/postfix/access

to /etc/postfix/

added DISCARD TestDiscard

to /etc/postfix/access


postmap /etc/postfix/access

Reloaded / Restarted postfix, and emails still get sent to and from the email address blocked.

Does this setting in /etc/postfix/ make a difference:

mailbox_command = /usr/bin/procmail -a "$EXTENSION"
share|improve this question
up vote 3 down vote accepted

Well, Dovecot has nothing to do with this, it should all be done in the MTA.

Blocking based on the sender or recipient is trivial -- just use access lists (as per access(5)) in the sender and recipient restriction configs. Notifying another e-mail address is, IMO, best handled by a log parser.

share|improve this answer
Ok, got that, /etc/postfix/access done, added it to the config file. But no blocking, accepting all emails, sending all emails. I'll post details – PostMan Oct 15 '09 at 9:34
Got it :) thanks – PostMan Oct 15 '09 at 9:56

Try using smtpd_recipient_restrictions instead of smtpd_client_restrictions. The client option puts restrictions on the client that is connecting to the server, while the recipient option puts a restriction on the recipient email address, in this case you want the recipient and not the client restrictions.

The method you put will restrict any mail coming from the address, not to that address.

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.