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.

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
sender==badsender@domain.com; recipient==myreceiver@domain.com; action=REJECT no sender

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

share|improve this question
add comment

2 Answers 2

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 bob@example.net to send mail to your user alice@example.com:

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

alice@example.com mail_for_alice

And mail_for_alice would contain:

bob@example.net 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
add comment

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
add comment

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.