Bug 67570

Summary: formail causes sigpipe; procmail doesn't ignore it
Product: [Retired] Red Hat Linux Reporter: Jonathan Kamens <jik>
Component: procmailAssignee: Jens Petersen <petersen>
Status: CLOSED UPSTREAM QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-01-06 02:43:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Jonathan Kamens 2002-06-27 16:14:54 UTC
If you use "|formail -D" in a procmailrc to detect and discard duplicates, it
frequently won't work because formail exits as soon as it detects the duplicate,
thus causing procmail to get a SIGPIPE trying to write the rest of the message
to formail, and it doesn't detect and ignore the SIGPIPE, so it decides that the
delivery to formail failed.

Formail should probably read the entire message even if it's going to discard
it, to avoid SIGPIPE.  At the very least, it should have an option to enable
this behavior.  And procmail should probably ignore SIGPIPE errors writing to
delivery filters -- if the filter exited with status 0, it closed prematurely on
purpose and procmail should consider the message delivered.

(A workaround is to put the "h" flag in the procmail recipe so that only the
header is fed to formail, but this shouldn't be necessary.)

Comment 1 Trond Eivind Glomsrxd 2002-07-03 19:50:52 UTC
Any testscenario? I use

:0 Wh: msgid.lock
| formail -D 8192 /home/devel/teg/Mail/msgid.cache

myself, receive a huge amount of mail and haven't seen any problem...

Comment 2 Jonathan Kamens 2002-07-03 19:53:40 UTC
As I said in my initial bug report, the problem goes away if you put the "h"
flag in the recipe, as you do in the example you gave.  I'm saying that it
shouldn't occur even when there's no "h" in the recipe.


Comment 3 Philip Guenther 2002-09-21 06:41:45 UTC
The reporter should file a bug against whatever documentation showed formail -D
being used to suppress duplicates without using the 'h' flag on the recipe.  All
the examples in the procmail documentation show the 'h' flag, so I'm not sure
where the incorrect recipe came from.

Changing the behavior of formail -D to discard the message body (but not when
splitting messages, of course) is reasonable.  I'll add it to my todo list,
though I have no idea when it'll ever get done (my procmail maintenance time has
been sorely limited for a while now).