0

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"
Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151
PostMan
  • 115
  • 5

2 Answers2

3

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.

womble
  • 96,255
  • 29
  • 175
  • 230
  • 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 09:34
1

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.

Dave Drager
  • 8,375
  • 29
  • 45