Bug#128160: Also affects 'formail'

2007-09-03 Thread Michelle Konzack
Am 2007-08-28 20:52:49, schrieb Athanasius:
   This bug with 'procmail -d user' also causes 'formail -i ...' to

Not right, since it does NOT affect formail.  formail is right by
adding a blanc line since From can only be in a Body NOT THE HEADER.

 further corrupt the message, but the bug is dependent on the headers
 present before the non-RFC compliant 'From ' header.

I have never seen such From headers.

   If we start with a message whose headers begin:
 
   From [EMAIL PROTECTED] Tue Aug 28 20:14:03 2007
   Return-path: [EMAIL PROTECTED]
   Envelope-to: [EMAIL PROTECTED]
   Delivery-date: Tue, 28 Aug 2007 20:14:03 +0100

Question:

When do you get a Message with a From  Header?  --  I do not
know a singel MTA or fetchmail/getmail which add a From  Header.

Do you try to deliver the content of a Mailbox to -d user?

If yes, it is the wrong way because

procmail -d ${USER} mail_file

works only IF the mail_file was from a Maildir.  Otherwise you
should use:

formail +1 mail_file -ds procmail -d ${USER}


 Note the addition of a blank line, causing premature end of headers.
 In fact formail has now not REPLACED the Content-Type header, it's added
 a new one.  If the 'From ' line is filtered out before calling formail
 then things work properly.

The behaviour of formail is right.

   It would seem that 'From ' should be turned into something
 RFC-compliant, not 'From ', maybe 'Old-From_: ' ?

Maybe you should correct the WRONG From  header before you try to
change working programs...


Thanks, Greetings and nice Day
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSN LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Bug#128160: Also affects 'formail'

2007-08-28 Thread Athanasius
  This bug with 'procmail -d user' also causes 'formail -i ...' to
further corrupt the message, but the bug is dependent on the headers
present before the non-RFC compliant 'From ' header.

  If we start with a message whose headers begin:

From [EMAIL PROTECTED] Tue Aug 28 20:14:03 2007
Return-path: [EMAIL PROTECTED]
Envelope-to: [EMAIL PROTECTED]
Delivery-date: Tue, 28 Aug 2007 20:14:03 +0100

And then deliver it using 'procmail -d athan', we get:

From [EMAIL PROTECTED] Tue Aug 28 20:14:03 2007
From athan  Tue Aug 28 20:14:03 2007
Return-path: [EMAIL PROTECTED]
Envelope-to: [EMAIL PROTECTED]
Delivery-date: Tue, 28 Aug 2007 20:14:03 +0100

Now, within procmail we run it through, bogofilter -e -p -u, and get:

From [EMAIL PROTECTED] Tue Aug 28 20:14:03 2007
From athan  Tue Aug 28 20:14:03 2007
Return-path: [EMAIL PROTECTED]
Envelope-to: [EMAIL PROTECTED]
Delivery-date: Tue, 28 Aug 2007 20:14:03 +0100

Then, as bogofilter isn't catching everything, we run it through,
spamassassin, and get:

From [EMAIL PROTECTED] Tue Aug 28 20:14:03 2007
X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on 
bowl.fysh.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.6 required=3.0 
tests=AWL,BAYES_00,UPPERCASE_25_50 
autolearn=ham version=3.1.7-deb
From athan  Tue Aug 28 20:14:03 2007
Return-path: [EMAIL PROTECTED]
Envelope-to: [EMAIL PROTECTED]
Delivery-date: Tue, 28 Aug 2007 20:14:03 +0100

Note how SpamAssassin has inserted some headers after the properly
formed 'From ' header, but before the improperly formed 'From ' header.

Now we run it hits a procmailrc rule to set Content-Type correctly for
inline PGP signed messages, which filters it through:

formail -i Content-Type: application/pgp; format=text; x-action=sign

and the headers end up as:

From [EMAIL PROTECTED] Tue Aug 28 20:14:03 2007
X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on
bowl.fysh.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.6 required=3.0
tests=AWL,BAYES_00,UPPERCASE_25_50 
autolearn=ham version=3.1.7-deb
Content-Type: application/pgp; format=text; x-action=sign

From athan  Tue Aug 28 20:14:03 2007
Return-path: [EMAIL PROTECTED]
Envelope-to: [EMAIL PROTECTED]
Delivery-date: Tue, 28 Aug 2007 20:14:03 +0100

Note the addition of a blank line, causing premature end of headers.
In fact formail has now not REPLACED the Content-Type header, it's added
a new one.  If the 'From ' line is filtered out before calling formail
then things work properly.

  It would seem that 'From ' should be turned into something
RFC-compliant, not 'From ', maybe 'Old-From_: ' ?

  Now to see if I can make procmail strip/change that badly formed
header

-Ath
-- 
- Athanasius = Athanasius(at)miggy.org / http://www.miggy.org/
  Finger athan(at)fysh.org for PGP key
   And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence. Paula Cole - ME


signature.asc
Description: Digital signature