Hello everyone,
I've installed maildrop on my FreeBSD 7 machine with
postfix+courier-imap. I use mysql
for my virtual maps. I'm trying to setup per-user maildrop filters in
the virtual users'
folders; however for some odd reason the included file is ignored and
subsequently not
parsed. Any help would be appreciated to try and debug this.
Here are the permissions for the files in question ahead of time:
-rwxrwx--- 1 vmail postfix 3.5K Jun 9 20:16 /var/log/maildroprc.log
-rw-r--r-- 1 root mail 959B Jun 9 20:16 /usr/local/etc/maildroprc
-rwsr-xr-x 1 root mail 168K Jun 9 19:57 /usr/local/bin/maildrop
-rw-r--r-- 1 vmail postfix 272B Jun 9 20:09
/usr/home/vmail/domain.tld/user2/mailfilter
The 'mail' group has the users 'vmail' and 'postfix'.
That being said, I have a default maildroprc file in /usr/local/etc
with the following:
#!/usr/local/bin/bash
logfile "/var/log/maildroprc.log"
LOGNAME=tolower("$LOGNAME")
if ( $SIZE < 262144 )
{
exception {
xfilter "/usr/local/bin/spamc -f -u $LOGNAME"
}
}
if ( `test -r $DEFAULT/mailfilter` == 0 )
{
exception {
log "Including $DEFAULT/mailfilter..."
include "$DEFAULT/mailfilter"
}
}
if (/^X-Spam-Flag: *YES/)
{
exception {
to "$DEFAULT/.Spam/"
}
}
else
{
exception {
to "$DEFAULT"
}
}
In my /var/log/maildroprc.log, the `log "Including
$DEFAULT/mailfilter..."` line properly
outputs the correct location of my per-user mailfilter. Such as the
following:
Including /usr/home/vmail/domain.tld/user2//mailfilter...
Date: Mon Jun 9 20:16:53 2008
From: use...@domain.tld
Subj: 2
File: /usr/home/vmail/domain.tld/user2/ (1443)
So I would assume that since the "Including" segment I had logged
passes, the include
line immediately following that should be executed as well.
Here is user2's mailfilter:
if ( /^To: [0-9]+@test\.com:h )
{
exception {
log "email accepted!!!"
to "|/path/to/script"
}
}
else
{
exception {
log "email rejected!!!"
EXITCODE=0
exit
}
}
I never see either of these 2 log lines in /var/log/maildroprc.log.
Mail sent to
use...@domain.tld is delivered to its inbox like every other normal
virtual user on the
machine.
Any help or insight as to how to try and track down why I cannot
include per-user
mailfilters would be greatly appreciated!
Thanks in advance!
Patrick