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 19, 2004 4:25:44 am
List:net.sourceforge.lists.courier-maildrop

Mike,

I read your email below and decided to give you a clean explanation of my setup rather than inserting my comments between your lines. I would recommend that you give this a try because it is working fine on two systems. Hope it helps.

postfix: main.cf --------------------- (I do not use the "mailbox_command=/usr/local/maildrop/bin/maildrop") virtual_transport = maildrop

postfix: master.cf ------------------------ maildrop unix - n n - - pipe flags=DRhqu user=vmail:vmail argv=/usr/local/bin/maildrop -d ${recipient} -f
${sender} ${extension} -w 80

maildrop: /etc/maildroprc --------------------------------- (the other day someone argued that "cc "|/usr/bin/sa-learn --single --ham"" is an unnecessary step)

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" } } }

spamassassin: /etc/mail/spamassassin/local.cf --------------------------------------------------------------- report_safe 1 required_hits 9 rewrite_subject 0 subject_tag [SPAM]

# handling headers add_header all Level _STARS(-)_ add_header all Report _REPORT_

# Enable the Bayes system use_bayes 1 bayes_auto_learn 1 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

# white list hosted domains whitelist_from *@domain.tld (domain.tld should be changed to a real domain)

# white list for individual email addresses whitelist_from us@domain.tld

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

to "$HOME/Maildir" fails to deliver to every virtual user's directory because $HOME here is /home/vmail.

On Sun, 2004-04-18 at 20:32, Mike Anderson wrote:

Hi Joaquim,

thank you for the excellent publication online. Though i think it is gonna help me a lot, I still have some loose ends to tie with my configuration of LDAP+MailDrop+Postfix+Squirrelmail+Spamassassin and I was hoping if you would be kind enough to give some insights into it. I'd really appreciate your help.

My configuration is same as you are using.

I have a working setup of LDAP+MailDrop+Postfix+Squirrelmail+Spamassassin right now i am trying to move detected spam to .Spam folder using maildrop, i am using maildir and absoulte path for a virtual user is "/home/vmail/domains/domain.tld/username/". currently i am using very simple configuration just this line in /etc/maildroprc " to "$HOME/Maildir" but this seems to deliver mail to "/home/vmail/domains/Maildir" folder and i am not able to direct maildrop to send recipient's virtual mailbox and its address is stored in LDAP database. I need a way through which i can tell maildrop to drop mail to virtual user's maildir mailbox may be we can get home directory and mailbox path from LDAP database. Is it possible call LDAP attributes in /etc/maildroprc file so that by using that may be can deliver mail to virtual user. If there is another way to deliver mail to user's virtual mailbox with or without LDAP i would like hear about it.

I am going to try your config may be i will get it working.

Currently if i want to use maildrop then i need to force postfix to use maildrop only then i use following line but then i could get spamassassin working. and while using this if i try to send mail to external address like yahoo.com i get this error in maillog "relay=maildrop, delay=0, status=bounced (user unknown. Command output: Invalid user specified. )"

------------------ -o content_filter=maildrop

maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/local/maildrop/bin/maildrop -d ${recipient}

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

and if i want to detect spam and use maildrop also then i have to use as following

----------------------- # -o content_filter=maildrop

-o content_filter=spamassassin

maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/local/maildrop/bin/maildrop -d ${recipient}

spamassassin unix - n n - - pipe user=nobody argv=/usr/bin/spamc -f -e /usr/bin/sendmail -oi -f ${sender} ${recipient}

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

and in above both cases main.cf i have used

mailbox_command=/usr/local/maildrop/bin/maildrop

i am not sure about this configuration pls guide me in this regard.

Thank you very much