I've got a mostly working system w/ squirrelmail + spamassassin and users
being able to modify settings in spamassassin through squirrelmail
(spamassassin grabs it's configuration data from spamassassin).

I have vpopmail set with spamhandling controlled through
/var/lib/vpopmail/etc/mailfilter

---- /var/lib/vpopmail/etc/mailfilter ----
import EXT
import HOST

SHELL="/bin/sh"
VHOME=`/var/lib/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]

VPOP="$VHOME/Maildir/"
if ( "no such user" =~ /$VHOME/:d )
{
VDOMHOME=`/var/lib/vpopmail/bin/vdominfo -d $HOST`
VPOP3=`cat $VDOMHOME/.qmail-default | cut -f4 -d' '`
VPOP="$VPOP3/Maildir/"
EXT=`echo $VPOP3|cut -f7 -d'/'`
}
USERDEFINEDSPAMSTATUS = 0;

USERDEFINEDSPAMSTATUS=`grep spamc /var/www/data/[EMAIL PROTECTED]
>/dev/null 2>/dev/null|wc -l`

# run through SpamAssassin (if less than the specified size)
if ( $SIZE < 262144 )
{
   if ( $USERDEFINEDSPAMSTATUS == 0 )
   {
   exception {
      xfilter "/usr/bin/spamc -f -u [EMAIL PROTECTED]"
   }
   }
}

exception {
include "/var/www/data/[EMAIL PROTECTED]"
}
exception {
to "$VPOP"
}

--- /var/lib/vpopmail/etc/mailfilter ---

The above script grabs all custom filter settings dropped by spamassassin
and works fine, EXCEPT in the following circumstances:

you have a catchall and you send a message to the catchall, then it
executes the script except $EXT (and also possibly $HOST is wrong if it is
a aliased domain) as vpopmail does not bother to change that variable.

Question is should vpopmail be changed so that the $EXT and $HOST reflects
the domain and user the mail is being delivered too, or should it stay
with what the site the mail is trying to be delivered too.

In case of a forward to the real address the above script works perfectly.

-Myron




Reply via email to