Spamassasin->Dovecot

VermeulenHans

New member
Joined
Apr 14, 2009
Messages
3
Hi ,

I used to use sa-learn in my squirrelmail using the howto DirectAdmin knowlegdebase 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
 
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
 
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

Code:
#!/bin/bash
#
#    Script created by
#    StevenHsu
#    [email protected]
#
#    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;
 
Last edited:
Back
Top