procmail
[Top] [All Lists]

Re: formail header concatenation

2009-01-24 21:06:12
On Sat, Jan 24, 2009 at 07:04:19PM +0100, Per Jessen wrote:

Dallman Ross wrote:

[big snip]
If you think you can prove something different, please let's see it.
Use my test rcfile shown above, if you want.

My suspicion is ther Per's terminal is not showing him tab chars
correctly, is all.

Hi Dallman

I didn't discover this on my terminal, but because a regex failed to
pick out the right bits of a formail concatenated string.  

Here's an excerpt of a test email:  http://jessen.ch/files/testemail2

Run this

formail -c <testemail2 | grep ^Received | head -1 | hexdump -c

Okay, I'll run it in a minute.  But before I do, let's clear up
a few things.

First, somehow I didn't pay attention to your Subject line in the
message thread where you clearly spoke of formail.  Then I started
talking about procmail, not formail.  Obviously, these are two
different programs.  So I should have tested formail, not procmail,
to rebut or confirm your assertions about formail, not procmail. :-)

Second, we don't actually have to grep Received lines to extract
only Received lines using formail.  We can use formail to extract
the Received lines. :-)  Saves us the bother of a grep, anyway.

Third, I use formail extensively for back-testing, and I still
have not seen your complaint.  For example, here is the first
Received line from your message that I'm answering now:

   2:44am [~/Mail] 610[0]> formail -c -X Received: < per | sed 1q
  Received: from mail2.panix.com (mail2.panix.com [166.84.1.73])  by 
mailbackend.panix.com (Postfix) with ESMTP id 27DD6D5C0      for 
<dman+nomo(_at_)panix(_dot_)com>; Sat, 24 Jan 2009 13:06:06 -0500 (EST)

I still do see tabs, and I see no missing whitespace, and I'm using
the current production formail under NetBSD 5.0 Beta:

   2:46am [~/Mail] 618[64]> sh -c "formail -v 2>&1" | sed 1q
  formail v3.22 2001/09/10


Now I will go grab your sample Received line.

   2:52am [~/Mail] 629[0]> w3m http://jessen.ch/files/testemail2 -dump > 
testemail2

(Be careful, those playing along at home.  When I did the above with lynx
instead of w3m, tab chars in Per's source file were converted to spaces.
With the version of w3m I have on my shell host, though, the tab chars
were left as-is.)


Here's your test, but without your results:

   2:54am [~/Mail] 632[0]> formail -c <testemail2 | grep ^Received | head -1 | 
hexdump -c
  0000000   R   e   c   e   i   v   e   d   :       f   r   o   m       d
  0000010   i   n   g   b   a   t   .   e   x   a   m   p   l   e   .   c
  0000020   o   m       (   d   i   n   g   b   a   t   .   e   x   a   m
  0000030   p   l   e   .   c   o   m       [   2   1   .   2   1   .   2
  0000040   1   .   2   1   ]   )      \t   b   y       s   r   v   1   .
  0000050   e   x   a   m   p   l   e   .   c   o   m       (   P   o   s
  0000060   t   f   i   x   )       w   i   t   h       E   S   M   T   P
  0000070       i   d       1   7   0   9   C   4   D   0   D   3      \t
  0000080   f   o   r       <   c   a   t   c   h   t   h   i   s   m   a
  0000090   i   l   @   j   e   s   s   e   n   .   c   h   >   ;       T
  00000a0   u   e   ,       2   0       J   a   n       2   0   0   9    
  00000b0   1   0   :   1   2   :   4   8       +   0   1   0   0       (
  00000c0   C   E   T   )  \n                                            
  00000c5
  
Here's my test (identical result):

   2:55am [~/Mail] 634[0]> formail -c -X Received: < testemail2 | sed 1q | 
hexdump -c
  0000000   R   e   c   e   i   v   e   d   :       f   r   o   m       d
  0000010   i   n   g   b   a   t   .   e   x   a   m   p   l   e   .   c
  0000020   o   m       (   d   i   n   g   b   a   t   .   e   x   a   m
  0000030   p   l   e   .   c   o   m       [   2   1   .   2   1   .   2
  0000040   1   .   2   1   ]   )      \t   b   y       s   r   v   1   .
  0000050   e   x   a   m   p   l   e   .   c   o   m       (   P   o   s
  0000060   t   f   i   x   )       w   i   t   h       E   S   M   T   P
  0000070       i   d       1   7   0   9   C   4   D   0   D   3      \t
  0000080   f   o   r       <   c   a   t   c   h   t   h   i   s   m   a
  0000090   i   l   @   j   e   s   s   e   n   .   c   h   >   ;       T
  00000a0   u   e   ,       2   0       J   a   n       2   0   0   9    
  00000b0   1   0   :   1   2   :   4   8       +   0   1   0   0       (
  00000c0   C   E   T   )  \n                                            
  00000c5
  

I think maybe the package you have on your system comes broken, then.
That's all I can think of.  Try grabbing the formail source and
recompiling it yourself.

Btw, I was in Zurich on Monday.  Had I noticed your identifying
geography from your post, I could have had lunch with you. :-)

Dallman
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail