Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

Thanks.


Details:

Ok so I've added

smtpd_client_restrictions = check_client_access hash:/etc/postfix/access

to /etc/postfix/main.cf

added

myemail@address.com DISCARD TestDiscard

to /etc/postfix/access

ran

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/main.cf make a difference:

mailbox_command = /usr/bin/procmail -a "$EXTENSION"
share|improve this question

2 Answers 2

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 myemail@address.com, not to that address.

share|improve this answer

Your Answer

 
discard

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.