Making your Spam mail box easier to check for Ham...

David Relson relson at osagesoftware.com
Sat Jun 28 00:50:45 CEST 2003


At 03:49 PM 6/27/03, Jonathan Hunt wrote:
>Hi folks,
>
>I was thinking about how I could make checking my Spam mail box for Ham
>a little quicker today, and thought it would be nice if I could see
>the Spam scores for the messages without having to read each one.
>
>My first thought was that I'd have get the score added to the
>message subject, but I couldn't think of a way to do it easily.
>Instead, I noticed that Mutt (the mailer I use to check my spam)
>can be configured to display a general purpose mail header
>called X-Label.
>
>Using the following sed filter...
>
>   sed
>'/^X-Bogosity:.*spamicity=[0-9.]*/G;s/\(^X-Bogosity:.*spamicity=\([0-9.]*\).
>*\)\(\n\)/X-Label: \2\3\1/'
>
>
>...you can generate an extra header for the score that looks
>something like this...
>
>   X-Label: 0.987600
>
>
>I use this in my .procmailrc file like this...
>
># Call bogofilter
>:0fw
>| bogofilter -u -e -p -o 0.49999 | sed
>'/^X-Bogosity:.*spamicity=[0-9.]*/G;s/\(^X-Bogosity:.*spamicity=\([0-9.]*\).
>*\)\(\n\)/X-Label: \2\3\1/'
>
>
>You can then put a line similar to the following in your .muttrc file
>(It's the %-4.4y bit that does the business) to display the score in
>the message index...
>
>   set index_format="%4C %Z %{%b %d} %-15.15L (%4l|%-4.4y) %s"
>
>
>This produces an index that likes something like this...

... [snip] ...


>I've found it very useful.  It speeds up my "Spam folder Ham scan" no end.
>I hope others might find it useful too.
>
>Perhaps something similar could be included into Bogofilter in a future
>version?  Perhaps an option to add the score to the subject, or a user
>defined header like X-Label?

Jonathan,

An interesting idea.  Bogofilter has several related (but not fully 
connected) features.

First, bogofilter.cf can contain "spam_header_name=***any string***".  It 
allows substituting a different string for the "X-Bogosity" in the 
bogofilter status line.  You _could_ use value X-Label and have an 
"X-Label: ..." line instead of the "X-Bogosity: ..." line.

Second, bogofilter.cf contains a number of formatting directives for the 
spam header line, a.k.a. the "X-Bogosity" line.  This allows a _lot_ of 
flexibility in formatting the line.  Look at bogofilter.cf and 
bogofilter.cf.example for samples.

Lastly, bogofilter.cf can contain "spam_subject_tag=***any 
string***".  When used, spam message subjects will have the value of 
spam_subject_tag included as a prefix.  Ham message subjects are not changed.

At present, the spam_subject_tag is used exactly as it appears in the 
config file.  Likely it's only a matter of a few lines of code to apply 
bogofilter's formatting capability (as used in the spam header line).  This 
would give a lot of capability to the spam_subject_tag.  Additionally, it 
would be easy to add ham_subject_tag and unsure_subject_tag.

Anybody want to try their hand at modifying bogofilter's code???

David





More information about the Bogofilter mailing list