The override persists only for the condition in which it is defined. Here's a slightly-altered experiment to demonstrate:
pm-test.rc
:0 H
* ^To:.*recipient
* B ?? tribbles
* space
mailbox
test-mail.txt
From: space-alert@storage.com
To: recipient@local.net
Your storage locker is overflowing with
tribbles. Please clean it out.
Note that the word "space" appears only in the headers of the above message.
test-mail2.txt
From: alert@star.fleet
To: recipient@local.net
We're having some trouble with
tribbles at our space station.
Note that the word "space" appears only in the body of the above message.
If the B
override does not expire at the end of its condition, pm-test.rc
should succeed on the second message because "tribbles" is in the body and "space" is (only) in the body.
% procmail VERBOSE=on DEFAULT=/dev/null MAILDIR=/tmp pm-test.rc < test-mail2.txt
procmail: Match on "^To:.*recipient"
procmail: Match on "tribbles"
procmail: No match on "space"
procmail: Assigning "LASTFOLDER=/dev/null"
The recipe does not succeed.
Conversely, if the B
override does expire at the end of its condition, pm-test.rc
should succeed on the first message because "tribbles" is in the body and "space" is (only) in the headers.
% procmail VERBOSE=on DEFAULT=/dev/null MAILDIR=/tmp pm-test.rc < test-mail.txt
procmail: Match on "^To:.*recipient"
procmail: Match on "tribbles"
procmail: Match on "space"
procmail: Assigning "LASTFOLDER=mailbox"
The recipe does succeed.
So, conditions after the B
override are unaffected by said override.
They go back to using the recipe's original flags (H
).
$H
was a shell variable which contains the message's headers, and$B
its body, and$HB
(as well as$BH
) their concatenation. – tripleee Oct 18 '17 at 19:26