openbsd-ports/mail/bmf/files/OpenBSD-bmf-mini-howto.html

111 lines
2.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>bmf mini-howto</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >
<link rel="STYLESHEET" href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/docbook.css">
</head>
<body>
<h3>Theoretical part:</h3>
<p>Before you start to use bmf it is a good thing to know a little of
the theoretical background of
<a href="http://www.paulgraham.com/spam.html">Bayesian spamfiltering</a>
<h3>Basic installation:</h3>
<p>Put this at the top of your <tt class="FILENAME">.procmailrc</tt>.
<dl><dd><pre>
:0fw
* &lt; 256000
| bmf -p
:0e
{
EXITCODE=$?
}
:0:
* ^X-Spam-Status: Yes
caughtspam # This is the mailbox where all spam goes.</pre></dd></dl>
<p>Now you have to tell bmf the difference between spam and non-spam messages.
As an example you can add these shortcuts to your <tt class="FILENAME">.muttrc</tt>
<dl><dd><pre>
macro index &lt;f3&gt; "|bmf -S\n&lt;save-message&gt;=zspam\n" "SPAM"
macro index &lt;f4&gt; "|bmf -N\n&lt;save-message&gt;=Maildir\n" "NO SPAM"
macro pager &lt;f3&gt; "|bmf -S\n&lt;save-message&gt;=zspam\n" "SPAM"
macro pager &lt;f4&gt; "|bmf -N\n&lt;save-message&gt;=Maildir\n" "NO SPAM"
</pre></dd></dl>
<p>Now you can press the F3-button to tell bmf the message is spam and the F4-button to tell bmf this wasn't spam.
<h3>Feeding a spam-archive to bmf:</h3>
<p>To speed up the process of feeding the bmf-database you can also
download a recent
<a href="http://www.em.ca/~bruceg/spam/">spam archive</a>
and run the files in the archive through the following oneliner:
<dl><dd><pre>for i in * ; do bmf -s -i $i; done</pre></dd></dl>
<h3>Mixing with spamassassin:</h3>
<p>You can also mix bmf with
<a href="http://spamassassin.org">spamassassin</a>.
This has the advantage that bmf is much lighter than spamassassin and
all messages missed by bmf but caught by spamassassin will be fed to
the bmf-database automatically.
All you have to do is to change the spamfilter-part of your
<tt class="FILENAME">.procmailrc</tt> to:
<dl><dd><pre>
:0fw
* &lt; 256000
| bmf -p
:0e
{
EXITCODE=$?
}
:0:
* ^X-Spam-Status: Yes
caughtspam
:0fw
* &lt; 256000
| spamc -p 4321 -f
:0e
{
EXITCODE=$?
}
:0:
* ^X-Spam-Status: Yes
{
:0c
| bmf -S
:0
caughtspam
}
</pre></dd></dl>
<h3>Disclaimer:</h3>
<p>If anything bad happens to your email I am not responsible. If you
know improvements to this document please send them to the maintainer
of this port.
</body>
</html>