On 3/4/2014 7:31 AM, Nilesh Govindrajan wrote: > On Tue, Mar 4, 2014 at 6:49 PM, Matthias Egger <maeg...@ee.ethz.ch > <mailto:maeg...@ee.ethz.ch>> wrote: > > I would like to make sure, that these specific upgrade mails > coming from > <sa...@software.tld> sent to <secret...@ee.ethz.ch > <mailto:secret...@ee.ethz.ch>> will be redirected > to another address. But Emails coming from <some...@somewhere.tld> > (which also could include <some.othersen...@software.tld>) should > receive a regular "Recipient address rejected: User unknown" > message. > > > I'd totally solve this problem using sieve at IMAP level.
That would create a bounce, not a reject, for unwanted mail. > But an alternate postfix level solution is - > > http://mattshaw.org/news/how-to-filter-mail-with-postfix-header_checks/ > & http://www.postfix.org/header_checks.5.html > > (untested!!) > > if /^From: sales@software\.tld/ > /^To: seceratary@ee\.ethz\.ch/ REDIRECT ... > endif header checks evaluate one line at a time and cannot do multiline logic. However, you can do this with either a smtpd restriction class or with a policy server such as postfwd. http://www.postfix.org/RESTRICTION_CLASS_README.html http://www.postfix.org/SMTPD_POLICY_README.html http://postfwd.org/ -- Noel Jones