9 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Server side spam filt...
FromSent OnAttachments
Joaquim LaureanoApr 14, 2004 3:06 pm 
Robin WhittleApr 14, 2004 8:22 pm 
Tony EarnshawApr 15, 2004 1:26 am 
Rolan YangApr 15, 2004 6:53 am 
Joaquim LaureanoApr 15, 2004 8:35 am 
Rolan YangApr 16, 2004 4:07 am 
Mike AndersonApr 18, 2004 5:34 pm 
Tony EarnshawApr 19, 2004 4:13 am 
Joaquim LaureanoApr 19, 2004 4:25 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] Server side spam filtering with spamassassinActions...
From:Joaquim Laureano (laur@lusostar.com)
Date:Apr 15, 2004 8:35:40 am
List:net.sourceforge.lists.courier-maildrop

Rolan,

In the software world we constantly hear of new/different ways to accomplish any task. You might have a quite valid point about the sa-learn step. I will
take a better look at it. You mention a few other things that might be questionable.

I agree with the premises that it is better to filter on the server because it
avoids client access delays. For instance I have read stories saying that Squirrelmail can take a long time to to display at login time when it does the filtering and
it has to process a large number of messages. As you are likely aware, customers want systems to be very responsive.

The POP3 issue is only valid if you give users access to it. That is a decision that you have to make.

I shared what I thought to be a good way to achieve my goal. I will certainly stay away from claiming it to be the best one, since others can provide examples that they say do a better job. If you have an innovative way to do the work, please share it.

On Thu, 2004-04-15 at 09:52, Rolan Yang wrote:

Doesn't spamassassin autolearn ham/spam with bayes turned on already? Running messages through sa-learn again would not really improve the accuracy and running borderline spam (my or may not be) could actually decrease the bayes accuracy.

I have a similar postfix/maildrop/spamassassin configuration, but instead of having maildrop presort the spam into the appropriate folders, Squirrelmail does it with a filter rule. The reason is that POP3 users are unable to fetch their spam if it has already been sorted into a folder other than Inbox.. Any false positives would be missed.

What would be useful is something similar to Yahoo/Hotmail, where, in the mail client, users could selectively mark the message "as spam" or "ham" which would then trigger a script to send the message to sa-learn.

Joaquim Laureano wrote:

Fellows,

I have been on the receiving side for a while when it comes to take advantage of the good work that lots of you have been doing. The following is an attempt to start contributing, too. I hope it is useful for others. The maildroprc file is based on information I got from the Internet, including the emails in this list. Use it as you see fit.

I have 2 mail servers with the following major setup pieces: RedHat 9.0 postfix 2.0.16 courier-imap 2.1.1 maildrop 1.6.1 squirrelmail 1.4 spamassassin 2.63

Squirrelmail is a very good webmail. I am quite impressed with all the nice plugins including spamassassin and bayesspam. However I wanted to have spam filtering even for those customers who choose to use email clients such as evolution, mozilla, or Outlook Express. When I started trying to use the bayes filtering feature of spamassassin on the server I came across a few difficulties, which I believe I have overcome in a nice way. For instance I wanted an email identified as spam, or possible spam, to go to folders in the customers accounts labeled spam and assumedspam. This allows all the email to stay in the customers accounts, thus avoiding any conflict with the law. Moreover, no email is deleted and the customer has the opportunity to review it.

The most important part of the work was the "maildroprc" file. I am assuming that who ever wants to use the information that I am providing already has a woking email server. Here is the parts that I think will be essential for others to get the same setup:

---------------------------------------------------------------------------------------

/ETC/POSTFIX/MASTER.CF (this is only the entry for maildrop) maildrop unix - n n - - pipe flags=DRhqu user=vmail:vmail argv=/usr/local/bin/maildrop -d ${recipient} -f ${sender}

--------------------------------------------------------------------------------------- /ETC/MAILDROPRC

VHOME="/home/vmail/vhosts" ACCOUNT=`echo $LOGNAME | cut -d@ -f1` USERDOMAIN=`echo $LOGNAME | cut -d@ -f2`

if ( $SIZE < 26144 ) { exception { xfilter "/usr/bin/spamc" } }

if (/^X-Spam-Flag: *NO/) { exception { to "$VHOME/$USERDOMAIN/$ACCOUNT/Maildir" cc "|/usr/bin/sa-learn --single --ham" } } else { if ( /^X-Spam-Level: *-----.*$/ ) { if( test -d $VHOME/$USERDOMAIN/$ACCOUNT/.Spam ) { `maildirmake -f Spam $VHOME/$USERDOMAIN/$ACCOUNT` `echo INBOX.Spam >> $VHOME/$USERDOMAIN/$ACCOUNT/courierimapsubscribed` }

exception { to "$VHOME/$USERDOMAIN/$ACCOUNT/.Spam" } cc "|/usr/bin/sa-learn --single --spam" }

if ( /^X-Spam-Level: *-.*$/ ) { `test -d $VHOME/$USERDOMAIN/$ACCOUNT/.AssumedSpam` if( $RETURNCODE == 1 ) { `maildirmake -f AssumedSpam $VHOME/$USERDOMAIN/$ACCOUNT` `echo INBOX.AssumedSpam >> $VHOME/$USERDOMAIN/$ACCOUNT/courierimapsubscribed` }

exception { to "$VHOME/$USERDOMAIN/$ACCOUNT/.AssumedSpam" } } }

-------------------------------------------------------------------------------------------

/ETC/MAIL/LOCAL.CF

required_hits 9 rewrite_subject 0 subject_tag [SPAM]

clear-headers add_header spam SPAM SPAM

# Enable the Bayes system use_bayes 1 report_safe 1 always_add_headers 1 bayes_auto_learn 1 add_header all Level _STARS(-)_ spam_level_stars 1 spam_level_char - bayes_min_ham_num 200 bayes_min_spam_num 200 bayes_auto_learn_threshold_nonspam 0.1 bayes_auto_learn_threshold_spam 12.0 bayes_path /etc/mail/spamassassin/bayes

# privileged settings allow_user_rules 0