[Mimedefang] Mimedefang + Spamassassin + Learning.

Jeff Rife mimedefang at nabs.net
Mon Dec 1 21:38:54 EST 2008


On 1 Dec 2008 at 16:52, Adam Harrison wrote:

> I would like to set up a couple learning addresses on my mail server for
> spam and ham.
> 
> Basically I would like to be able to forward mail to spam at mailhost or
> ham at mailhost and have sa-learn process it, but I would like to still use
> mimedefang as a front end to strip the forward parts of the message and
> unencode all the mime encoded parts of the messages.

First, I run MIMEDefang and SpamAssassin as the "defang" user, and I 
use a single bayes database.  If you have a configuration where 
individual users can have their own bayes database, then you can't 
really do what you want.

In /etc/aliases:
##########################################
isspam:         defang+spam at mailhost
notspam:        defang+ham at mailhost
##########################################

In ~defang/.procmailrc:
##########################################
MAILDIR=$HOME/Mail
LOGFILE=$MAILDIR/log/procmail

COMSAT=no
VERBOSE=off
LOGABSTRACT=all

SPAMHAM = $1

:0
* SPAMHAM ?? ham|spam
| sa-learn --$SPAMHAM --no-sync
##########################################

Then you execute:
root at mailhost# su - defang
defang at mailhost:~$ ln -s /etc/mail/spamassassin/local.cf .spamassassin/user_prefs

This makes sure that any SA program run as the defang user will use the 
same config file that is used by MD.  You don't have to do this, but 
it's the easiest way to make sure they always use the same bayes 
database.

After that, you can resend any mail you receive to "isspam" or 
"notspam" and have it learned.  Note that if you reject e-mail as spam 
but it wasn't really, you obviously can't learn it as ham, since you 
never got it in the first place.


--
Jeff Rife |  
          | http://www.nabs.net/Cartoons/Zits/AttentiveIgnorer.jpg 





More information about the MIMEDefang mailing list