"Stephen A. Cochran"
<stephen(_dot_)a(_dot_)cochran(_dot_)lists(_at_)cahir(_dot_)net> writes:
On Tuesday, November 26, 2002, at 02:14 AM, Philip Guenther wrote:
If you place the 'h' flag on the recipe, that warning
from procmail should disappear. You can also combine the two formail
commands:
:0 h
* > 31000
| formail -rxTo: | perl ./doError.pl junk errTooBig
Thanks. I didn't think I needed the h flag since the man page listed it
as the default. Solved that one easily.
Well, the h and b flags together are the default. That is, using neither
flag is the same as using both.
...
So I'd want something like this?
mTO= `formail -xTo:`
mFROM= `formail -xFrom:`
mSUBJECT= `formail -xSubject:`
# mBODY= `formail -I ""`
# mHEADER = `formail -X ""`
:0
| perl ./parser.pl "$mTO" "$mFROM" "$mSUBJECT"
And then in the perl script for a while (<>) to get entire message, and
then call formail from the perl script to split them apart? Or even
just use formail from the perl script and don't pass any arguments in?
It's been about two years since I wrote this, but I seem to remember
that I had problems when I tried to do it that way at first.
Just split them apart in perl: everything up to a line that consists of
just a newline is the header, everything after that is the body.
# do whatever with the header
while (<>) {
last if /^$/;
blah blah blah...
}
# make sure there's a body
if (defined $_) {
# do whatever with the body
while (<>) {
blah blah blah ...
}
}
Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail