procmail
[Top] [All Lists]

Re: Utility to maintain user addresses

1995-12-14 11:35:22
Soren Dayton writes on 14 December 1995 at 10:27:26

John said:

On Wed, 13 Dec 1995, Eric Hilding wrote:

You can purge out duplicates with a perl script, etc.

So.....do you or anyone else on the list have a script (perl, tcl, sh)
that will do this?  Yes, easy enough to write, but if it's already
written.....

sh:

#!/bin/sh

sort $1 | uniq > tempfile
mv tempfile $1

Add the appropriate locking

I didn't read the original message on this topic, but what about using
"formail"?  Except for the sorting, it will do the same thing as the
above shell script.  Something along the lines of

#####
##### Save away Email addresses of anyone who ever sent me mail
##### A Reply-To: line overrides the From: line
##### * Don't save local addresses or those from programs (bounced mail,
#####   mailing lists, etc.)
##### * Resent-* header lines mean I wasn't an original recipient
##### * don't save addresses from lists or flaged with "junk" precedence
##### * be sure I was an explicit recipient for any mailing lists that
#####   slip through the recipies above.
#####
YEAR=`date +%Y`
:0Whci:from_deposit.lock # h is not critical, nor usually is i
* !^FROM_DAEMON
* $!^(Reply-To|From|Sender):.*${FQDN}
* !^Resent-(From|To):
* !^Precedence: ?(junk|list|bulk)
* $^TO${ME_REGEXP}
| formail -r -D 99999999 from_deposit_${YEAR}

   Dan
--------------------- message is author's opinion only --------------------
J. Daniel Smith <DanS(_at_)bristol(_dot_)com>              
http://www.bristol.com/~dan
Bristol Technology Inc.                     +1 203 438 6969, 438-5013 (FAX)
Ridgefield, Connecticut (USA)                       
{info,jobs}(_at_)bristol(_dot_)com
                                 --------
Von guten Maechten wunderbar geborgen, erwarten wir getrost, was
kommen mag.  Gott ist mit uns am Abend und am Morgen, und ganz gewiss
an jedem neuen Tag.  - Dietrich Bonhoeffer

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