procmail
[Top] [All Lists]

Re: filter number(_at_)foobar(_dot_)com

1999-08-15 06:18:31
PSE-L(_at_)mail(_dot_)professional(_dot_)org (Professional Software 
Engineering) writes:
At 18:42 1999-08-14 +0200, Christophe Zwecker wrote:
...
And lastly, 
add a caret '^' before Content in the grep operation.  Why?  Because your 
grep will currently match any line containing "Content-", whether at the 
start or not.  You'd be better off using formail to strip these headers, 
since your grep, even with the caret, won't distinguish between lines 
appearing in the header, and those in the body.

Even worse, it will only remove the first line of a Content-* header
and leave the continued line which will then appear at the end of the
previous header.  If this is a multipart message then the Content-Type:
header is most likely continued, so this will not be an isolated problem.

...
It shouldn't be too difficult to strip the headers with formail, but I 
haven't been following your thread enough to know what the mimedump process 
is doing outputting.  Theoretically, the following should work, but might 
not if I'm presuming incorrectly:

:0:
| mimedump | formail -b -I "Content-" >> /var/spool/mail/mailfile

If this is a mbox style mailfile then you should _not_ use the -b flag,
as it will result in messages containing "From " lines in the body
being split.  I would, on the other hand, strip the Mime-Version: header
in the above:

        :0:
        | mimedump | formail -IMime-Version: -IContent- \
                >> /var/spool/mail/mailfile


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>