> Date: Sat, 5 Jan 2002 01:56:47 +0800
> From: Charles Jie <[EMAIL PROTECTED]>
> To: Mutt Mail-list <[EMAIL PROTECTED]>
> Subject: Possible to get the mail fetched by getmail filtered?
> 
> Now I have a mail system = postfix + mutt + procmail + getmail.
> 
> getmail fetches my mail in some POP3 servers. But it just places mail in
> some mboxes - compared to the mail received by postfix and
> sorted/filtered by procmail - and looks having no way to sort/filter
> mail further.
> 
> How do you do it for POP3 mail? (some of these mailboxes do be able to
> 'forward' mail to my server, but inevitably add lines to message header.
> :)
> best,
> charlie

    Hi Charles,

    as pointed out by others, you made a good choice with getmail over
    fetchmail, since the latter breaks the unix philosophy "do one
    thing, but do it right".

    While getmail has some rudimentary filtering facilities (just like
    mutt has some rudimentary POP3 facilities), it's not a mail filter.
    So to get your mail filtered, you need to put another tool between
    getmail and your mailboxes. I use getmail with maildrop, and have it
    configured like this:

    getmailrc:
   
    [mail.cz]
    ...
    postmaster = "|/usr/bin/env PERSONA=mail.cz maildrop /path/to/maildroprc"
    [mobil.cz]
    postmaster = "|/usr/bin/env PERSONA=mobil.cz maildrop /path/to/maildroprc"

    maildroprc:
   
    MAILDIR  = "$HOME/Mail"
    LISTDIR  = "$MAILDIR/lists"
    PHPDIR   = "$LISTDIR/php"
    WORKDIR  = "$MAILDIR/work"
    
    if (/^list-post: <mailto:php-qa@lists\.php\.net>/)
    {
        to "$PHPDIR/php-qa"
    }

    if (/^list-post: <mailto:dev@subversion\.tigris\.org>/)
    {
        to "$LISTDIR/svn-dev"
    }

    if (/^Subject: .* Genesis2 zmeny/)
    {
        to "$WORKDIR/cvs"
    }

    if (/^From: .*@mobil\.cz/ || /.*genesis@mobil\.cz/)
    {
        to "$WORKDIR/mobil.cz"
    }

    to "$MAILDIR/IN.$PERSONA"


    My maildrop config is somewhat longer, but you get the idea.


-- 
FreeBSD 4.4-STABLE
8:19PM up 9 days, 6:57, 18 users, load averages: 0.15, 0.09, 0.05

Reply via email to