From: Professional Software Engineering
Sent: Tuesday, December 30, 2003 9:59 AM
At 21:59 2003-12-29 -0800, Gary Funck wrote:
From Gary Funck <gary(_at_)intrepid(_dot_)com> Sun Dec 28 23:45:39 2003
Subject: RE: Interlocking log output and LOGABSTRACT?
Folder: procmail-mail 6707
Won't happen unless you rewrite the message headers. There's a
with doing this however: if for some reason, you deliver a bounce, or
forward that message and attempt to retain the (modified) From_
line on it,
the individual who submitted it to a *LIST* is going to receive a
bounce. That's plain rude, since they didn't send it to you -
the list did.
Your TRAP idea seems a good workaround to that (since the
won't have been rewritten)
Right. I definitely do not plan to rewrite the headers *as delivered* into
their respective mbox's, but am just futzing with the mail to get formail -l
to output the log file message abstract that I'm looking for.
Here is the solution that I've come up with:
TRAP='formail -I "From " | formail -l "$LASTFOLDER"'
It sure is great that '-l' (ell) still isn't documented in the formail
Yeah, it was news to me as well. I do find it documented under "man formail"
under Redhat 9.0, however. Interestingly, the man page says it was last
updated on 2001/08/04, formail -v says "formail v3.22 2001/09/10".
However, the only thing I see your TRAP doing is making formail
update the timestamp on the From_ line. The address remains constant. I
ran it against a volume of mail here, and it always had the same result.
I had to tweak that TRAP invocation a bit. Here is what I have now:
TRAP='formail -I "From " -I Return-Path: -I Sender: -I Errors-To: | \
formail -l "$LASTFOLDER"'
As you can see, formail was quite reluctant to use the From: info. when
regenerating the From_ line.
You should be able to eliminate the pipe though:
TRAP='formail -I "From " -a "From " -l "$LASTFOLDER"
(see the "BUGS" section of the formail manpage - if you expressly remove
the From_ header formail won't regenerate it unless you expressly tell it
to add it).
While this doesn't make it change the address (at least from where I'm
sitting), this achieves the same result as yours, but with one
invocation and no shell (though I might be wrong about that - I'm
versed in TRAP).
Excellent, thanks. Here's what the new attempt:
TRAP='formail -I 'From ' -a 'From ' -I Return-Path: -I Sender: -I
Errors-To: -l "$LASTFOLDER"'
A single formail invocation that isn't terribly worse than 'formail -l'.
but it gives the output that I'm looking for.
Colour me surprised.
See above. Ignoring a few extra headers seemed to give the desired result.
procmail mailing list