-----BEGIN PGP SIGNED MESSAGE-----
On Fri, 10 May 1996, Gino Filicetti wrote:
:0
* ^Subject: coc subscribe*
* !^X-Loop: ginof(_at_)io(_dot_)org
* !^Subject:.*Re:
* !^FROM_DAEMON
{
:0hwc
* ^Subject: coc subscribe \/[^ ]*
FROM_ADDRESS=| formail -xTo:
This should be:
FROM_ADDRESS=| formail -rxTo:
^
I'm not sure if I included the r in my previous post, but it should have
been there.
The r generates a reply message, so the To: that is extracted is the
original sender. If it isn't there, formail will just return your address.
NAME="$MATCH"
:0fib
| echo "ADD coc-ezine cronosmantas $FROM_ADDRESS $NAME"
:0ab
^
I'm not sure about the b flag. I think sendmail needs the complete message.
! listproc(_at_)lists(_dot_)colorado(_dot_)edu
}
$NAME is extracted beautifully, and everything else works, the only thing
I need is to find a way to BETTER extract the sender's address, or someway
to filter "Gino Filicetti <ginof(_at_)io(_dot_)org" to read only
"ginof(_at_)io(_dot_)org"
You can match again on FROM_ADDRESS:
:0
* FROM_ADDRESS ?? <\/.*$
{ FROM_ADDRESS=$MATCH }
This will take everything after a < sign. If there's no <, nothing happens.
If you still need more sophisticated address processing, check out Alan
Stebbens' procmail library. You can get it from (I hope this address is
still valid, Alan moved recently):
http://eci2.ucsb.edu/~aks/mail/procmail-lib.shar
It contains recipes to extract email addresses.
- --
Guy Geens <guy(_dot_)geens(_at_)elis(_dot_)rug(_dot_)ac(_dot_)be>: Ph.D.
student at ELIS -- TFCG / IMEC
Home Page: http://www.elis.rug.ac.be/ELISgroups/tfcg/staff/gg.html
finger ggeens(_at_)elis(_dot_)rug(_dot_)ac(_dot_)be for PGP public keys (or use
keyserver)
"Engineering is the art of modeling materials we do not wholly understand,
into shapes we cannot precisely analyse so as to withstand forces we cannot
properly assess, in such a way that the public has no reason to suspect the
extent of our ignorance."
- Dr AR Dykes
British Institution of Structural Engineers, 1976.
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
Comment: pgp fingerprints in message headers
iQBVAwUBMZLtGnwHoCha5QR1AQHuvQIAj/7eZ5fAn8+PpeqoA9iXBGd3fEyVXeaI
nWE/b42Tt2JjqKpFM5JJjfS2s4lMgRj3zyq/T+JO6xw7+D81eRVLkw==
=Hk+d
-----END PGP SIGNATURE-----