Thank you for replying but I still do not understand it. Are you saying that I should swap rules' places? I have already tried that before posting my quesion but it doesn't help. The matter is that these rules work OK one by one, but when put together the REPLACE rule is skipped wheather it comes before or after the other rule.
1. REPLACE doesn't work. /^From:\s*assistant\@gmail\.com$/ REPLACE Subject: New Report. /^Subject:\s*$/ REJECT Empty subjects fields are rejected. 2. REPLACE doesn't work either. /^Subject:\s*$/ REJECT Empty subjects fields are rejected. /^From:\s*assistant\@gmail\.com$/ REPLACE Subject: New Report. Does it perhaps mean that each email' to, from, subject, and body fields are treated as just one single rule, and the query is stopped whenever all of these 4 per 1 message are matched? Any more pointers, please? Many thanks! Den -----Original Message----- From: Wietse Venema <wie...@porcupine.org> To: Postfix users <postfix-users@postfix.org> Sent: Sat, 08 Jun 2019 19:16 Subject: Re: Regexp Postfix query doesn't stop at the first matching rule Den1: > 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. man header_checks: DESCRIPTION Each message header or message body line is compared against a list of patterns. When a match is found the corresponding action is executed, and the matching process is repeated for the next message header or message body line. Thus, it stops at the first match. If the Subject line matches first, then that rule determines the result. Wietse