I thought I had solved this problem for a client of mine.

At the domain level, qmail seems to read .qmail-<ext> then .qmail-default file
for delivery instruction.  So if your .qmail-test file says /user/Maildir
(default by qmailadmin), it'll completely bypass .qmail-default.  Yes, your
.qmail-test should include <maildrop> <mailfilter> like in .qmail-default, which
will invoke maildrop but spam tagging rule will be ignored because it can't find
you "test" alias in the database.

You can choose to fix it at the database schema level, which probably will
require a re-architecting the whole system.  Fortunately, maildrop can be
scripted to manipulate the way mail is delivered.  What I've done was added a
little code in the mailfilter file:

# Environment variables needed
import HOME
import EXT      # user
import HOST     # domain

if("$xALIAS" ne "x")

and my .qmail-test would say:

/path/to/maildrop /path/to/mailfilter user

so when maildrop is invoked, mailfilter checks to see if there's a command line
option passed to it.  If there is, change the environment variable EXT and pass
it through spamd.

If you choose to do it at the user level, i.e. Maildir/.qmail, it might not work
(depending on your mailfilter) because it'll execute maildrop and then
delivermail, which would then reads .qmail-ext and .qmail-default, then
Maildir/.qmail and the cycle is repeated.  Even if you can program your
mailfilter to break the cycle, CPU time is wasted in another qmail cycle.

Then again, my approach runs into problem when you have a .qmail-<forward> file
because of the loosely defined .qmail-<ext> system, but that's another topic.


Jasper Metselaar wrote:

I have a real [EMAIL PROTECTED] which is tagged for spam checking. The .qmail-default contains

| /usr/local/bin/maildrop <mailfilter file>

which calls maildrop and in mailfilter, runs through spamd to check for spam then pass 
it back to vdelivermail to deliver to the proper mailbox. Then I created a [EMAIL 
PROTECTED], which is an alias to [EMAIL PROTECTED] A .qmail-test is created which 
points to mydomain.com/user/Maildir. When an email
is sent to [EMAIL PROTECTED], qmail just dumps it directly into user's 
mailbox,completely out of the spam checking task.

Shouldn't the .qmail-test file's content be the same as the .qmail-default file?
How do you enable alias to behave the same as the account that it's aliased to? Of 
course I can use a forwarder to [EMAIL PROTECTED] instead, but I don't think this is 
the best way....or?

Thanks in advance for your suggestions!



Reply via email to