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

I have a postfix installation with amavis and postfwd. I'd like to block a single sender only for a single receiver. I tried with header_checks but multiline checking I was thinking something like

id=BLOCKIT;; action=REJECT no sender

on postfwd but I can't find the proper syntax... Has anyone some suggestions?

share|improve this question

I don't know how to do this in postfwd, but within Postfix, you can use Restriction Classes for this. If you e.g. want to prevent to send mail to your user

smtpd_restriction_Classes = mail_for_alice
mail_for_alice = check_sender_access hash:/etc/postfix/mail_for_alice
smtpd_recipient_restrictions =
  check_recipient_access hash:/etc/postfix/special_recipients

The file special_recipients would contain a line like mail_for_alice

And mail_for_alice would contain: reject

That said, you are probably better of with doing all of this in postfwd ;-)

share|improve this answer
tried this but it was not working in my case: I needed to skip bounces only for a certain user... I would have liked to drop MAILER-DAEMON messages only to him, looks like restrictions are before bounces and probably even postfwd would not have worked... I finished using another workaround with an alias to a script – golemwashere Sep 19 '13 at 18:51

I have accomplished similar tasks using Postgrey. You could install postgrey and disable the greylisting feature, but retain the whitelist and blacklist features. Many people find Postgrey intrusive, I find it to be a nearly perfect spam filter.

share|improve this answer
thanks the best option would be using or postfwd or amavisd that are already installed and working, I'd rather not add extra software again – golemwashere Sep 16 '13 at 12:03

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.