Description of problem: Once the H flag has been enabled for a procmail rule, it can't be disabled in subsequent rules. Version-Release number of selected component (if applicable): procmail-3.22-9 How reproducible: Every time Steps to Reproduce: Create the procmailrc: :0HB: * Subject: header_test * message_body rule1 :0B: * Subject: header_test rule2 Send yourself a message with subject header_test, and a random body. Actual results: Message gets delivered to rule2. Expected results: Message should not have matched rule2, since that should *only* egrep the body, and not the header. Additional info: This is a known bug, and was fixed upstream in procmail-beta in September 2001(!) I'll attach a patch taken from procmail-beta that fixes the problem. (Basically, that when clearing the flags, the for() loop counts backwards down to 1, rather than down to 0.) [Note: I haven't tested that this patch doesn't break the header-checking by default, though I expect it will work properly.] For others encountering this problem, the workaround is to NEVER use the H flag. Just get really creative and figure out ways around it (it's the default, so workarounds aren't impossible, just annoying).
Created attachment 115343 [details] patch that clears flags properly
The supplied patch works, but only because the flags array is of char. The fix in the (not yet released <sigh>) master source tree uses sizeof(flags) instead of maxindex(flags) in the bbzero() call.
(In reply to comment #2) > The supplied patch works, but only because the flags array is of char. The fix > in the (not yet released <sigh>) master source tree uses sizeof(flags) instead > of maxindex(flags) in the bbzero() call. > Yes, and that's how we fix it in FC and RHEL-4.