Dave Robbins <dave(_at_)geol(_dot_)ucsb(_dot_)edu> writes:
I use several different email clients but mostly mailx on Solaris.
When I get mail from a user who does not use their real name in the
gecos field, I get garbage if it's from a list.
Hmm, can you give an example? Have you filed a bug report with Sun?
(What version of Solaris is this?)
What I'd like to do is use their email address in the angle-brackets.
For example, if I did this my From: address would look like this:
From: dave(_at_)geol(_dot_)ucsb(_dot_)edu
I want to test if there isn't an angle-bracketed name and
if so, change the user's From: address to look like:
From: dave(_at_)geol(_dot_)ucsb(_dot_)edu
<dave(_at_)geol(_dot_)ucsb(_dot_)edu>
Is this a prudent thing to do? Thanks for any help.
Define "prudent": if mailx mishandles the *simplest* form of address,
is it prudent to trust that it'll handle some of the other forms?
That's your call to make, of course. If you want to go ahead with it,
you could try a recipe like the following:
:0 fhw
* ^From:[ ]*\/[^ <,]+[ ]*$
* MATCH ?? ^^\/[^ ]+
| formail -i"From: $MATCH <$MATCH>"
That attempts to prevent the most egregious cases of shooting yourself
in the foot by only rewriting the From: header field if it contains
only a single sequence of non-whitespace characters, none of which are
open brackets or commas. That should keep it from choking on address
lists or wacky forms. It also saves the old From: header field as
Old-From:, so you can always dig up the original value.
p.s. Hey, what goes with procmail's -v option when using head or even grep?
% procmail -v |head -1
procmail v3.14 1999/11/22, Copyright (c) 1999, Stephen R. van den Berg
<srb(_at_)cuci(_dot_)nl>
...
It sends its output to stderr. If you're using a Bourne shell
derivative:
procmail -v 2>&1 | head -1
If you're using a csh derivative:
procmail -v |& head -1
Philip Guenther
Procmail Maintainer
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail