Email filters in python

Diez B. Roggisch deetsNOSPAM at web.de
Fri Dec 17 10:38:52 EST 2004


> ..........................
> - open POP-SSL connection to pop.someserver.com
> - Get all mails and store as Unix mail file (mymails)
> - do not delete mails from server
> - close connection.
> ..........................
> - open mymails file
> 
> - Do following for each mail in mymails file (one by one)
>     {
>         - get header fields:  {FROM, TO, CC, Subject,... more ... }
>         - some conditons (FROM is found my addresslist.txt but not part of
> my rejectlist.txt )
>             append that mail to some existing file.
>     }

For these two, use fetchmail and procmail.
> ..........................
> - open SMTP-TLS connection to smtp.someserver.com
>     - send all mails in my unix mail file
> - close connection

I'm not totally sure how to do this best - but here python might indeed
help, using smtplib and mailbox.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list