I host several virtual domains. Each domain is represented by a single Unix
user, and all mailboxes for that domain are owned by the virtual domain's
user. Individual mail account names are stored in a userdb.
Previously, I used a set of .courier files in each virtual domain user's
homedir to deliver mail. For instance, there was a .courier-tony file in the
example.com user's home directory. The file contained the location of tony's
maildir. Mail addressed to " <mailto:to...@example.com> to...@example.com" was
thus dispatched by courier to tony's maildir.
I recently started using maildrop for spam filtering and message delivery.
The critical piece of information I must provide to maildrop is the location
of the maildir. Currently, I do this by passing it as a commandline
parameter to maildrop. This means that each user's .courier file contains
the maildrop commandline:
| /usr/lib/courier/bin/maildrop .mailfilter
/home/v/example_com/mbox/tony
The problem is, each user still requires a .courier file. Furthermore, in
order to pass command line parameters to maildrop, I need to run maildrop in
manual mode, manually specifying the .mailfilter file and including
/etc/courier/maildroprc from inside the .mailfilter file. Clearly, this is
not optimal.
If maildrop could obtain the envelope recipient of a mail ("to...@example.com
<mailto:to...@example.com> "), then it could run userdb to obtain the user's
maildir. This would allow a single .mailfilter file in the virtual domain's
home directory to properly deliver mail to all of the domain's users. I
would no longer need a per-user .courier file, and all of my mail
administration would be greatly simplified.
Unfortunately, maildrop does not seem to be aware of this information. The
$LOGNAME variable always contains the name of the virtual domain user
("example_com") and the Delivered-To header contains an intermediate mail
address <mailto:exam...@mailserver.example.com>
exam...@mailserver.example.com" ... Maildrop is not powerful enough
to extract this intermediate address from the header and transform it into a
valid RFC822 address for userdb lookup.
Does anyone have an idea how to supply the envelope recipient to maildrop?
Thanks in advance,
-Tony