On 4/19/2015 7:03 PM, Simon wrote: > Hi There, > > We are using postfix 2.7.1 on debian. Is there a simple way to block > emails from a domain or From address only to a certain to address? > So this would match both from and to in the header to then block the > email. e.g. > > From: blockt...@domain.com <mailto:blockt...@domain.com> > To: cli...@theirdomain.com <mailto:cli...@theirdomain.com> > > Only when blockt...@domain.com <mailto:blockt...@domain.com> sent an > email to cli...@theirdomain.com <mailto:cli...@theirdomain.com> > would it get blocked, otherwise all other emails from > blockt...@domain.com <mailto:blockt...@domain.com> would be sent to > any other to address? > > Thanks > > Simon
You can use a restriction class to block mail for a specific envelope sender/recipient combination. The envelope addresses are what are logged by postfix, and may be different than what is in the From: and To: headers. http://www.postfix.org/RESTRICTION_CLASS_README.html If you must use the addresses listed in message headers, you will need a content filter such as SpamAssassin. -- Noel Jones