On 1/21/21 10:39 PM, Fourhundred Thecat wrote:
> Hello,
> 
> I am using regex header_checks for smtpd. This rule works fine:
> 
> /^Subject: Your parcel .*/ DISCARD
> 
> But when I try to do a recipient-specific rule
> 
> if /^To: <t...@mydomain.com>/
> /^Subject: Your parcel .*/ DISCARD
> endif
> 
> it does not work, even when the recipient is exactly <t...@mydomain.com>
> Any idea why ?


Because you are trying to test two different headers via a method that
can test only a single header at a time.  Your test requires the header
being tested to be simultaneously both the To: header and the Subject:
header, which clearly doesn't happen.  If the line being tested is the
To: header, it can never match the Subject: clause of your rule; if it
is the Subject: header, then it can never match the To: clause.

To do filtering of this kind you will have to do it somewhere else,
possibly in a milter.


-- 
  Phil Stracchino
  Babylon Communications
  ph...@caerllewys.net
  p...@co.ordinate.org
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.695

Reply via email to