PDA

View Full Version : Spamassasin->Dovecot



VermeulenHans
04-14-2009, 08:19 AM
Hi ,

I used to use sa-learn in my squirrelmail using the howto DirectAdmin knowlegdebase (http://help.directadmin.com/item.php?id=188) provided.

I had to reinstall one server and now DirectAdmin is using dovecot.
For this server i cant seem to make sa-learn work because it wont update ( i restored backup ) is there any way i can make sa-learn work for dovecot?
It says in the howto that The guide is for the mbox format, but can be adjusted to Maildir by making a few alterations.

Any one willing to point me in the right directions on howto do this on Maildir


Thanks Hans Vermeulen

VermeulenHans
04-16-2009, 03:13 AM
Anyone??? im really in need of this feature for dovecot

sintsu
11-09-2009, 11:50 AM
I have the same problem too... still finding the solution to create the learning folder in roundcube.

Is there anyone can give us a hint ? thanks :P

sintsu
11-17-2009, 11:31 AM
I wrote a script to use sa-learn under imap, sa-learn can learn spam and nonspam from user who use webmail.

You should use "crontab" -e to let this script to run once per hour.

Any suggestion is welcome :P



#!/bin/bash
#
# Script created by
# StevenHsu
# steven.hsu@itci.com.tw
#
# Warning: Use it very carefully, it's a bash script so if
# something is not clear, please read the bash documentation
#
# No responsability for damages and/or usage
#
# Developed for DirectAdmin

# Note: Make sure you create a .NonSpam folder under your Maildir to learn NonSpam mail

export base="/home"
for owner in `ls $base` ;
do
for domain in `ls $base/$owner/imap/` ;
do
for user in `ls $base/$owner/imap/$domain`
do
# spam
if [ -d $base/$owner/imap/$domain/$user/Maildir/.INBOX.spam/cur/ ]
then
if [ "$(ls -A $base/$owner/imap/$domain/$user/Maildir/.INBOX.spam/cur/)" ]
then
/usr/bin/sa-learn --spam $base/$owner/imap/$domain/$user/Maildir/.INBOX.spam/cur/*
# /bin/rm $base/$owner/imap/$domain/$user/Maildir/.INBOX.spam/cur/* #delete spam after sa-learned
fi
fi

if [ -d $base/$owner/imap/$domain/$user/Maildir/.INBOX.spam/cur/ ]
then
if [ "$(ls -A $base/$owner/imap/$domain/$user/Maildir/.INBOX.spam/cur/)" ]
then
/usr/bin/sa-learn --ham $base/$owner/imap/$domain/$user/Maildir/.NonSpam/cur/*
# /bin/rm $base/$owner/imap/$domain/$user/Maildir/.NonSpam/cur/* #delete Nonspam after sa-learned
fi
fi

done;
done;
done;

exit 0;