9 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] mailfilter does not r...
FromSent OnAttachments
Flemming BjerkeNov 27, 2006 2:52 pm 
Sam VarshavchikNov 27, 2006 3:37 pm 
Tony EarnshawNov 27, 2006 11:37 pm 
Flemming BjerkeNov 29, 2006 7:52 am 
Tony EarnshawNov 29, 2006 2:59 pm 
Flemming BjerkeDec 6, 2006 6:24 am 
Sam VarshavchikDec 6, 2006 3:29 pm 
Flemming BjerkeDec 6, 2006 10:27 pm 
Sam VarshavchikDec 7, 2006 4:10 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] mailfilter does not reactActions...
From:Flemming Bjerke (fl@bjerke.dk)
Date:Dec 6, 2006 6:24:45 am
List:net.sourceforge.lists.courier-maildrop

Wednesday 29 November 2006 23:59 skrev Tony Earnshaw:

Flemming Bjerke wrote: ...

I quotes Sam: "Obviously you've installed maildrop with non-default configuration settings, or other customizations. What's wrong is that you have not explained how you installed and configured maildrop, and how you expect your customized configuration to work."

My basic question is: How do I get maildrop to read certain mailfilter files?

....

You want your maildrop (you still don't write what version it is [1],

The version is 0.47-4sarge5> or

where you got it [2],

installed as a debian binary (aptitude install courier-maildrop)

or exactly how you configured it ]3])

See excerpts below.

to read a non-standard configuration file in /var/courier and behave in an undocumented way. You write: 'I setup MAILFILTERDIR="/var/mail/mailfilter" But, maildrop does react to files in the directory. The same goes for .mailfilter files in the virtual directories.'

But in the real world of mostly everyone on this list there is *NO* /var/mail/mailfilter and there are *NO* .mailfilter files in any (which? what are?) virtual directories. Where did you "set it up" (I presume this is another Debian - "I have a debian sarge installation" - peculiarity) and why should Courier maildrop care anyway?

Thanks to your mails, I understood that I was on a wrong track, and I better understand things now. So, forget about MAILFILTERDIR etc. If you look at the file below, I presume that if I add in maildroprc:

HOME = $DEFAULT

then maildrop will look up .mailfilter files in the virtual mail directories? Moreover, since I have started understanding the principles, I see that I could have used an include statement in maildroprc in order to put my general filtering rules there.

I don't think the point is debian peculiarities, but a vhcs-hack peculiarities. http://vhcs.puuhis.net/wiki/index.php/Maildrop_filter

Incidentally, why there are two exception statement in the end of the maildroprc file is not clear to me.

Flemming

--Tonni

from /etc/postfix/master.cf =============== maildrop unix - n n - - pipe flags=R user=vmail argv=/usr/bin/maildrop /etc/courier/maildrop rc ${recipient} ${user} ${nexthop}

cat /etc/courier/maildroprc =============== #!/bin/sh

LOGDIR="/home/vmail" logfile "$LOGDIR/maildroprc.log" log "Filter start"

SHELL="/bin/bash" DEFAULT="/var/spool/mail/virtual/$3/$2/" MAILDIR=$DEFAULT SPAM=".Spam"

VSCAN=1 SSCAN=1

# Only scan mails smaller than SCANSPAMSIZE for spam SCANSPAMSIZE="2000000"

# Only scan mails smaller than VSCANSIZE for a virus VSCANSIZE="2000000"

# Mailfilter directory MAILFILTERDIR="/var/mail/mailfilter" LOGNAME="$2@$3"

if (/^To:.bestyrelsen@itpol\.dk/) { if (/List-post:/) { to $MAILDIR } else { to "| /usr/bin/smtp2zope.py http://85.235.249.119:8080/mailinglister/bes/manage_mailboxer" } }

if (/^To:.medlemmer@itpol\.dk/) { if (/List-post:/) { to $MAILDIR } else { to "| /usr/bin/smtp2zope.py http://85.235.249.119:8080/mailinglister/medl/manage_mailboxer" } }

if( $VSCAN ) { if( $SIZE < $VSCANSIZE ) { exception { xfilter "/usr/bin/clamscan.sh" } }

# check if mail is marked as virus if(/^X-Virus-Status:.*INFECTED/) { exception { `test -d "$MAILDIR/.Virus/"` if ($RETURNCODE != 0) { `/usr/bin/maildirmake -f Virus $MAILDIR/` `echo INBOX.Virus >> $MAILDIR/courierimapsubscribed` } MAILDIR = $MAILDIR.Virus/ SSCAN=0 } } }

if( $SSCAN ) { if( $SIZE < $SCANSPAMSIZE ) { exception { #xfilter "/usr/bin/spamassassin -x" xfilter "/usr/bin/spamc -f -x -u $LOGNAME" } } if(/^X-Spam-Flag: *YES/) { `test -d $DEFAULT/$SPAM` if($RETURNCODE != 0) { `/usr/bin/maildirmake -f Virus $MAILDIR/` `echo INBOX.Virus >> $MAILDIR/courierimapsubscribed` } MAILDIR = $MAILDIR.Spam/ VSCAN=0 }

} exception { include $MAILFILTERDIR/$LOGNAME } exception { to "$MAILDIR" }