On Thu, Mar 24, 2011 at 11:54:03AM +0200, Tom Kinghorn wrote: > We have a number of clients who have misconfigured applications > on their network, which is sending anything from warning to info > messages to the developer. > > Our servers are used as an outbound relay (smarthost) for our > clients. > > Is there a way to filter messages before they are sent out > _ > example:_ > > If the mail comes from u...@domain.tld & the recipient is > anotheru...@anotherdomain.tld & the Subject is <whatever>, > then Discard / Reject the message
Headers are only available in the message body (DATA portion of SMTP's dialogue), so you would need a content filter or milter to filter as you have described. http://www.postfix.org/FILTER_README.html http://www.postfix.org/MILTER_README.html If you can figure out how to do this without relying on content, other options are available, including restriction classes and policy servers: http://www.postfix.org/RESTRICTION_CLASS_README.html http://www.postfix.org/SMTPD_POLICY_README.html -- Offlist mail to this address is discarded unless "/dev/rob0" or "not-spam" is in Subject: header