View Full Version : Maildrop and mailfilter
Radnor
02-16-2007, 12:31 PM
Has anyone created a successful .mailfilter that actually filters or deletes emails marked with [SPAM]?
Here's what I have in my .mailfilter file, but all the [SPAM] emails are still getting through:
USER=radnor
HOSTNAME=hostname is here
if ($SIZE < 131072)
{
exception {
xfilter "/usr/bin/spamc -u $USER@$HOSTNAME"
}
}
if ( /^X-Spam-Status: Yes, hits=![0-9]+\.[0-9]+! /:h)
{
exception {
to "/home/radnor/Mail/.spam/"
}
}
else
{
exception {
to "/home/radnor/Mail/"
}
}
Also, if I try to include logfile "/var/log/maildrop/maildrop.log" in there my mail simply disappears and no log is ever created. The maildrop folder is as such:
drwxr-xr-x 2 radnor radnor 4096 Feb 16 11:06 maildrop
Has anyone created a successful .mailfilter that actually filters or deletes emails marked with [SPAM]?
Here's what I have in my .mailfilter file, but all the [SPAM] emails are still getting through:
Also, if I try to include logfile "/var/log/maildrop/maildrop.log" in there my mail simply disappears and no log is ever created. The maildrop folder is as such:
drwxr-xr-x 2 radnor radnor 4096 Feb 16 11:06 maildrop
Use $HOME/maildrop.log. Maildrop runs as your user ID and is not chroot'd for performance reasons. Thus /var/log/maildrop/maildrop.log is the absolute path of the filesystem, not relative to your site and that is if we factor out the unprivileged user issue. Mailboxes, use $HOME/Mail/.spam/ instead (.Spam is already created under Mail/).
Visit http://apisnetworks.com/saconfig.php -- I already did the hard work for you.
dkozinn
02-16-2007, 02:02 PM
For what it's worth, mine has been working just fine. I built my .mailfilter files before Matt had a chance to build the "does it for you" version, but it looks pretty similar:
USER=yourusername
HOSTNAME=yourdomain.name
#VERBOSE=9
logfile $HOME/.maildrop.log
if ($SIZE < 131072)
{
exception {
xfilter "/usr/bin/spamc -u $USER@$HOSTNAME"
}
}
if (/^X-Spam-Flag:.*YES/)
{
# to "Mail/.Spam"
to /dev/null
}
I had orginally had everything going into a Spam folder, and then commented that out later and sent the spam directly to /dev/null.
I seem to recall that if there are issues with the config file, it won't work, (gee, that sounded pretty obvious!), including problems with the location of the log file causing it to not filter, so once you set things up you should be all set.
Radnor
02-16-2007, 03:04 PM
Visit http://apisnetworks.com/saconfig.php -- I already did the hard work for you.
Guess I should've looked there again to see the new stuff. :)
Thanks!
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.