Gary Funck wrote: > > The line to search for reads: > > > > HEADER = `$FORMAIL -X ""` # The space after the X is vital. > > > > http://pm-doc.sourceforge.net/pm-tips-body.html > > > > Thanks for the pointer. I think the situation discused in that example > is different than your usage. The space is required because formail needs > to see the explicit empty argument in order to know that it should return > all the headers.
Ok. I generalized that to specific tags as well. I did get an error before adding the space though... mmm... My bad. Tested it again, and no problem. > I've always used this form with no problems: > > FROM=`formail -rzxTo:` > REALLY_FROM=`formail -rtzxTo:` > > > > The only refinement that I'd add to the recipe above is to quote > > > $HEADERTAGVAL, > > > just in the unexpected event that the sender's address had a > > space in it, or > > > some such: > > > > > > :0 > > > * ? grep -i -x -q -F "$HEADERTAGVAL" $ADDRESSFILE > > > { > > > ISMAILINGLIST=yes > > > } > > > > The reason being, I assume, is though it wouldn't match anyway, the > > quotes would prevent an error. > > > > Yes. Procmail does its own variable substitution above, and if it saw > a space in the $HEADERTAGVAL it would view the resulting substitution > as two separate arguments. We don't expect spaces in the address, but it > won't hurt to bullet proof things a bit. While we're add it, we should add > a -e > switch as well (e-mail addresses can begin with a '-'). We can also squeeze > a few cpu cycles out if we don't make procmail/exec look up 'grep' on the > path. > > GREP=/bin/grep Every little bit helps. > :0 > * ? $GREP -ixqFe "$HEADERTAGVAL" $ADDRESSFILE > { > ISMAILINGLIST=yes > } > > FYI, RFC2822 (sec. 3.4) details the syntax of an e-mail address, > http://www.faqs.org/rfcs/rfc2822.html > > This page will tell you whether a given address is syntactically valid: > > http://www.breakingpar.com/bkp/home.nsf/Doc?OpenNavigator&U=87256B280015193F > 87256C40004CC8C6 > (short URL: http://tinyurl.com/3d98f) Thanks. Bryan > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click -- As a rule I sit quite still, but whenever I move I make a huge leap to the horror of all those to whom I am bound by the tender bonds of kinship and friendship. - (Soren Kierkegaard - Either/Or) http://www.wecs.com/content.htm This signature file is generated by Pick-a-Tag ! Written by Jeroen van Vaarsel http://www.google.com/search?hl=en&ie=ISO-8859-1&q=pick-a-tag ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk