<<< Date Index >>>     <<< Thread Index >>>

Re: How to save all mail addresses of existing mails?



On 12Nov2008 12:40, Chengqi(Lars) Song <songcq@xxxxxxxxx> wrote:
| I have over 1000 mails and I want to save all the mail addresses
| appeared in them to aliases. Is there an easy way to do this? It will be
| frustrating to do it one by one.

Well, I use the following script and python class:
  http://www.cskk.ezoshosting.com/cs/css/bin/cs-aliases
  http://www.cskk.ezoshosting.com/cs/css/lib/cs/mailAddresses.py

This is more for purposes of illustration, though you're welcome to use
the whole thing if you like. cs-aliases reads a mail item on stdin,
pulls all the addresses, then appends the new ones to a file.
You could easily adapt it to your task.

I use this to categorise addresses in my UNKNOWN folder, which contains
email that gets past my spam filter and doesn't match an existing mail
filing rule. Since I have a rule that matches "to me and from a known
address", this contains mostly spam but also a fair amount of messages
I haven't yet written a filter for or from people I know but haven't
told my mail system about. So for these latter non-spam messages I pipe
the message into cs-aliases with a category name, and it stashes new
addresses as being in that category (that in turn gets turned into some
automatic mail filing rules).

Let us know if this approach suits.
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

STUFF: Anything that can be used for homebrewing.
JUNK: Everything else you thought could be used for homebrewing, but can't.
        - Steve Casselman