Noel Jones-2 wrote > On 6/8/2019 10:11 AM, Den1 wrote: >> Hello, >> >> I would be really thankful if someone could clarify it, please. It says >> the >> following, "Postfix works as documented in regexp_table(5) and >> pcre_table(5), i.e. each query stops at the first matching rule. Now the >> following two rules are in conflict: >> >> /^From:\s*assistant\@gmail\.com$/ REPLACE Subject: New Report. >> /^Subject:\s*$/ REJECT Empty subjects fields are rejected. >> >> I doesn't stop at the first matching rule where the subject is replaced. > > No, it replaces the From: header with a second Subject: header. The > original Subject: is untouched. > > At that point, processing of the From: header is stopped and postfix > proceeds with the next header presented. > >> Instead, it stops at the second matching rule where empty subject fields >> are >> rejected. Thus, it causes trouble, instead of accepting mail from > > header_checks does not check headers added by postfix. > > And REJECT always wins. Rule processing is stopped as soon as a > rule resolves to REJECT, and the mail is rejected at the earliest > opportunity. > > >>
> assistant@ > that is being sent with an empty subject field, it >> rejects it as per the second rule. How do I make it stop at the first >> matching rule? Would highly appreciate any pointers / suggestions / >> assistance at all. Postfix 2.9.6. Many thanks! > > What you appear to be trying - if the mail is From some particular > address, replace the Subject: - cannot be done with header_checks. > > You can probably do this with MIMEDefang or another milter, but the > actual implementation is outside the scope of this list. > > > > -- Noel Jones Thank you so much! What a perfectly informative answer. It's utmost clear now. It explains now why all my tests failed. -- Sent from: http://postfix.1071664.n5.nabble.com/Postfix-Users-f2.html