[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: filtering email via perl?



On Tue, Jun 05, 2001 at 10:25:26AM -0500, will trillich wrote:
| okay. procmail and i are getting a divorce. we just don't
| see eye-to-eye any more.

You might want to try 'filter' then, it's part of the elm
distribution.  I don't know if it is packaged for Debian or not.

| i've seen people post actual perl code here, which somehow
| filters their email. is that "mailagent"? (i don't want
| to give command-line access to you average script-kiddie,
| so mailagent makes me nervous...)
| 
| how can i use perl to break emails into various mailfolders?

I don't know, but if you wanted to try Python there are several
modules which would help a lot :

    re      --  Regular Expressions
        http://www.python.org/doc/current/lib/module-re.html

    rfc822  --  parses RFC822 messages 
        http://www.python.org/doc/current/lib/module-rfc822.html#l2h-2610

    mimelib --  parses MIME messages
        http://www.python.org/doc/current/lib/module-mimetools.html

    mimify  -- MIME processing of mail messages
        http://www.python.org/doc/current/lib/module-mimify.html

    base64  -- encode and decode MIME base64 data
        http://www.python.org/doc/current/lib/module-base64.html

    quopri  -- encode and decode MIME quoted-printable data
        http://www.python.org/doc/current/lib/module-quopri.html

    mailbox --  handles various mailbox formats
        http://www.python.org/doc/current/lib/module-mailbox.html

    imaplib --  handles connection to IMAP servers
        http://www.python.org/doc/current/lib/module-imaplib.html

    poplib  --  handles connection to POP servers
        http://www.python.org/doc/current/lib/module-poplib.html

    smtplib --  handles connection to SMTP servers
        http://www.python.org/doc/current/lib/module-smtplib.html

These are all part of the standard python distribution.


If you really like Perl enough, then I would suggest either looking
for some existing modules (but I don't know where) or study the
relevant RFCs so you can handle messages properly.

-D



Reply to: