Re: [vchkpw] spamassassin with per-user settings

2003-03-05 Thread Dave Weiner
Iain wrote:
> Hi,
>
> I have been working on getting spamassassin working with vpopmail and
> SQL based user preferences with a fair amount of success.
>
> I use the following in my .qmail-default for a particular domain:
>
>> preline /usr/bin/maildrop /etc/spamassassin/mailfilter
>
> where the mailfilter is included at the bottom of this email. I have
> even backported the SAM module for IMP from CVS so that webmail users
> can adjust their spam settings.
>
> This all works well, creating a SPAM folder if it doesn't exist and
> moving any SPAM into that folder.
>
> The only problem is that the .qmail-default file will be overwritten
> by qmailadmin if the catchall settings are changed. I have seen a few
> people mention this on the list before but haven't seen an answer.
> Some people have suggested that procmail is the answer. Can anyone
> provide an example of how procmail can achieve similar results to the
> maildrop filter below?

No procmail, but if you instead call maildrop on a per-user basis from the
users .qmail file, you don't have to worry about the qmail-default being
rewritten :)

>
> ##
> mailfilter
> ##
> import EXT
> import HOST
> import HOME
> VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]
> VPOP="| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox"
>
> if ($SIZE < 262144)
> {
> xfilter "/usr/bin/spamc -u [EMAIL PROTECTED]"
> }
>
> if ((/^X-Spam-Flag:.*YES/))
> {
>`test -d $VHOME/Maildir/.SPAM`
>if( $RETURNCODE == 1 )
>{
>`maildirmake $VHOME/Maildir/.SPAM;chown -R vpopmail.vchkpw
> $VHOME/Maildir/.SPAM`
>}
>to "$VHOME/Maildir/.SPAM/"
> }
>
> to "$VPOP"

Ya know, it's fun watching this .mailfilter morph since I posted it to the
list.


Dave




[vchkpw] spamassassin with per-user settings

2003-03-04 Thread Iain
Hi,

I have been working on getting spamassassin working with vpopmail and SQL 
based user preferences with a fair amount of success. 

I use the following in my .qmail-default for a particular domain:

| preline /usr/bin/maildrop /etc/spamassassin/mailfilter

where the mailfilter is included at the bottom of this email. I have even 
backported the SAM module for IMP from CVS so that webmail users can adjust 
their spam settings.

This all works well, creating a SPAM folder if it doesn't exist and moving any 
SPAM into that folder.

The only problem is that the .qmail-default file will be overwritten by 
qmailadmin if the catchall settings are changed. I have seen a few people 
mention this on the list before but haven't seen an answer. Some people have 
suggested that procmail is the answer. Can anyone provide an example of how 
procmail can achieve similar results to the maildrop filter below?

##
mailfilter
##
import EXT
import HOST
import HOME
VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]
VPOP="| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox"

if ($SIZE < 262144)
{
xfilter "/usr/bin/spamc -u [EMAIL PROTECTED]"
}

if ((/^X-Spam-Flag:.*YES/))
{
   `test -d $VHOME/Maildir/.SPAM`
   if( $RETURNCODE == 1 )
   {
   `maildirmake $VHOME/Maildir/.SPAM;chown -R vpopmail.vchkpw 
$VHOME/Maildir/.SPAM`
   }
   to "$VHOME/Maildir/.SPAM/"
}

to "$VPOP"