for the FAQ: using Sylpheed

Bill McClain wmcclain at salamander.com
Wed Mar 16 16:49:10 CET 2005


How I use bogofilter with Sylpheed.

Since I have many sources of email, I like to consolidate them all into
a single spool file with fetchmail. That way should I need to switch to
a different MUA someday I can do so without re-entering all my servers,
account names and passwords. Therefore, much of this is independent of
the Sylpheed mail program.

Fetchmail hands incoming mail to postfix. I have postfix invoke procmail
by adding this line to the postfix main.cf:

    mailbox_command = /usr/bin/procmail

My .procmailrc is adapted from the bogofilter FAQ:

    PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:.
    MAILDIR=$HOME/Mail      
    #
    # let mail go to /var/spool by default
    #
    LOCKFILE=$HOME/.lockmail

    :0fw:
    | bogofilter -e -p -u

    # if bogofilter failed, return the mail to the queue, the MTA will
    # retry to deliver it later
    # 75 is the value for EX_TEMPFAIL in /usr/include/sysexits.h

    :0e
    { EXITCODE=75 HOST }

Note that I am using the "-u" flag which causes automatic registration
of mail in the bogofilter wordlist. This is probably a bad idea unless:
(1) you also use the "thresh_update" feature which reduces the number of
registrations, and(2) you are scrupulous about correcting incorrect
registrations.

When Sylpheed gets new mail each message is passed through the
filtering chain and sorted into various folders. My first two filters
check the"X-Bogosity" header and move messages with "Yes" and "Unsure"
into appropriate folders. The Sylpheed dialogue boxes build these
filters with a little typing, pointing and clicking. For example I have:

    Condition:
        header "X-Bogosity" matchcase "Unsure"

    Action:
        move "#mh/Mailbox/Spam/unsure"

Messages with "X-Bogosity" equal "No" drop through to the other filters
for sorting into people and project folders.

Besides "Spam" and "unsure" folders I also keep folders named "fp"
(false positive: good mail incorrectly classified as spam) and "fn"
(false negative: spam mail incorrectly classified as good). I manually
move misclassified messages into these folders when I encounter them,
for later correction.

Sylpheed supports user-written "Actions" which are little command line
macros which will operate on selected messages. I use these for manually
classifying"unsures" and correcting the misclassified:

    Register Spam:
        bogofilter -s <"%f"

    Register Ham:
        bogofilter -n <"%f"

    Unregister Spam:
        bogofilter -S <"%f"

    Unregister Ham:
        bogofilter -N <"%f"

Since misclassifications are rare, I don't bother to define actions such
as"-Ns" to do a correction in one step. I just do the appropriate
actions in sequence.

Periodically I inspect my Spam folder to verify that no good mail has
slipped in. I then transfer all the spam to an archive (or just delete
it). Unsures and misclassified messages are properly registered and
moved out of those folders.

Because I sometimes want to look inside the bogofilter scoring
mechanism, I also have two diagnostic Actions:

    BogoTest -vv:
        bogofilter -vv <"%f"

    BogoTest -vvv:
        bogofilter -vvv <"%f"

The first gives a short histogram showing the distribution of good and
bad words in a message. The second gives the complete scoring for every
word.

-Bill
-- 
Sattre Press                                      Pagan Papers
http://sattre-press.com/                    by Kenneth Grahame
info at sattre-press.com          http://sattre-press.com/pp.html
_______________________________________________
Bogofilter mailing list
Bogofilter at bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter



More information about the Bogofilter mailing list