Bowie Bailey wrote:
I think what you are missing is the 'xfilter' command for maildrop.
Here is the correct way:
4. DEFAULTDELIVERY is set to "| /usr/lib/courier/bin/maildrop"
5. /etc/courier/maildroprc has the command:
"xfilter /usr/local/bin/filter"
6. The filter program is designed to accept the entire email on
standard input, make any changes, and output the entire changed email
to standard output.
7. Maildrop continues normal delivery with the changed email.
This will let you use the normal packaged maildrop, which will get the
user information directly from Courier. You could still pass the
$USER variable to the filter program if you want different filtering
for different people. Keep in mind that an xfilter cannot directly
change the delivery of the message, it can only modify it. If you
want different delivery options (to a sub-folder, for instance), you
would need to have maildrop make those decisions based on headers
added by the filter.
Bowie
Thanks, this helped a lot. I am, however, having a new issue. Delivering
messages like this seems to ignore the users' .mailfilter files in $HOME. As a
workaround I tried adding a "include $HOME/.mailfilter", but if the file doesn't
exist, it defers the delivery.
Pertinant info from my configs:
DEFAULTDELIVERY="| /usr/bin/maildrop"
MAILDROPDEFAULT=./Maildir
my maildroprc:
import USER
import HOME
xfilter "/usr/local/bin/filter.php $USER"
if ( /^SPAMSPAMSPAMSPAM/ )
{
to /dev/null
}
#include $HOME/.mailfilter <- this was my attempt, commented out
to Maildir
Any thoughts?
Thanks,
Josh