Bug 160177 - Procmail H flag can't be unset once set
Procmail H flag can't be unset once set
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: procmail (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Brock Organ
http://www.xray.mpe.mpg.de/mailing-li...
RHEL3U7NAK
:
Depends On:
Blocks: 170445
  Show dependency treegraph
 
Reported: 2005-06-12 17:21 EDT by Damian Menscher
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-24 07:17:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
patch that clears flags properly (491 bytes, patch)
2005-06-12 17:21 EDT, Damian Menscher
no flags Details | Diff

  None (edit)
Description Damian Menscher 2005-06-12 17:21:31 EDT
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).
Comment 1 Damian Menscher 2005-06-12 17:21:31 EDT
Created attachment 115343 [details]
patch that clears flags properly
Comment 2 Philip Guenther 2005-09-20 02:40:34 EDT
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.
Comment 3 Peter Vrabec 2005-09-20 04:38:23 EDT
(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.

Note You need to log in before you can comment on or make changes to this bug.