Bug 845644

Summary: procmail header recovery bug
Product: Red Hat Enterprise Linux 6 Reporter: Kelsey Cummings <kgc>
Component: procmailAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED CURRENTRELEASE QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-03 19:12:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kelsey Cummings 2012-08-03 17:34:16 UTC
Description of problem:
Procmail is supposed to recover and use the original header if a header filter fails.  However, due to this bug only the first character of the original header is recovered and available to subsequent recipes and/or delivery. 


Version-Release number of selected component (if applicable):
3.22-25.1


How reproducible:
100%

Steps to Reproduce:

:0fw                                                                                                                                                               
|/usr/bin/false                                                                                                                                                    

Results in:

procmail: Executing "/usr/bin/false"
procmail: Program failure (1) of "/usr/bin/false"
procmail: Rescue of unfiltered data succeeded

And the data is properly recovered as expected.

:0fhw                                                                                                                                                              
|/usr/bin/false                                                                                                                                                    

Results in:

procmail: Executing "/usr/bin/false"
procmail: Program failure (1) of "/usr/bin/false"
procmail: Rescue of unfiltered data succeeded

Only the first character of the headers is actually recovered. 

Additional info:
Already reported to and fixed in FreeBSD a couple years ago.
http://www.freebsd.org/cgi/cvsweb.cgi/ports/mail/procmail/files/patch-src%3Amailfold.c

My original patch used 

readdyn(&new,&dfilled,tobesent);

but the freebsd patch to

readdyn(&new,&dfilled,thebody-themail.p);

Also seems to work fine, not sure which is More Correct.

Comment 2 Kelsey Cummings 2012-08-03 18:49:09 UTC
!#$%#$%  sorry!

Bug already fixed in RHEL, brought in by procmail_3.22-8.debian.patch

Comment 3 Jaroslav Škarvada 2012-08-03 19:12:35 UTC
Closing per comment 2.