5 messages in net.sourceforge.lists.courier-usersRe: [courier-users] Correct way to do...
FromSent OnAttachments
Josh GrebeNov 18, 2005 11:52 am 
Bowie BaileyNov 18, 2005 12:22 pm 
Josh GrebeNov 21, 2005 11:21 am 
David BruhaNov 21, 2005 12:41 pm 
Bowie BaileyNov 21, 2005 12:42 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] Correct way to do local delivery after custom filtering (maildrop without authlib)Actions...
From:Josh Grebe (jo@shortcutsolutions.net)
Date:Nov 21, 2005 11:21:41 am
List:net.sourceforge.lists.courier-users

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