1 message in net.sourceforge.lists.courier-maildrop[maildropl] Re: maildrop create Maild...
FromSent OnAttachments
Dallas EngelkenNov 12, 2002 7:45 am 
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:[maildropl] Re: maildrop create Maildirs on the flyActions...
From:Dallas Engelken (dall@nmgi.com)
Date:Nov 12, 2002 7:45:43 am
List:net.sourceforge.lists.courier-maildrop

Ethan James wrote:

Is it possible to have maildrop create Maildirs on the fly? Postfix seems to do this fine, but maildrop complains when it can't find the Maildir. Any info would be appreciated.

FOLDER=`date "+%Y-%m"` if( /qmail@li.../ ) { `/usr/local/bin/maildirmake -f qmail.$FOLDER /home/eric/Maildir` to "Maildir/.qmail.$FOLDER/" }

I use this to filter messages on the qmail mailinglist to monthly folders. However I get a error message in the log for when that the directory exists after the folder is created. But it works :) , I dont know if it can be removed.

I want to share my solution with you. This will prevent you from those errors.
I pipe all message through spamassassin for my users, and then store all spam in
the .Spam sub-maildir. If this .Spam maildir does not exist, I simply create
it. Doing a test to see if the maildir exists first will prevent those
errors... Here is my mailfilter.

bigd@mailgw # cat mailfilter ###################################### # MAIL.HUTCHNET.COM MAILFILTER # # AUTO-BOUNCE IF USERDIR NOT PRESENT # # AUTO-SPAM MAILDIR CREATION # # MODIFIED 11/1/2002 # ###################################### VPOP="| /var/vpopmail/bin/vdelivermail '' bounce-no-mailbox" VHOME=`/var/vpopmail/bin/vuserinfo -d $EXT@$HOST`

`test -d $VHOME/Maildir` if ( $RETURNCODE == 1 ) { # BOUNCE MAIL.. USER DOES NOT EXIST echo "Sorry, no mailbox here by that name. (#5.1.1)" EXITCODE=100 exit }

`test -d $VHOME/Maildir/.Spam` if ( $RETURNCODE == 1 ) { # CREATE .Spam maildir under user VHOME `/usr/local/bin/maildirmake -f Spam $VHOME/Maildir` }

if ( $SIZE < 262144 ) { exception { # PULL VIRTUAL USER PREFS FROM SQL DATABASE xfilter "/usr/bin/spamc -f -u $EXT@$HOST" } }

if (/^X-Spam-Flag: *YES/) { exception { # PULL USERS MAILFILTER IF PRESENT include $VHOME/Maildir/.mailfilter } exception { # DELIVER TO USERS .Spam MAILDIR to "$VHOME/Maildir/.Spam" exit } exception { # THIS STATEMENT SHOULD NEVER BE REACHED IF SPAM-FLAG WAS YES.. BUT JUST
HERE FOR SAFETY # LET VPOP HANDLE DELIVER # IN CASE OF CATCHALL, YOU DONT WANT TO DELIVER DIRECTLY TO A USERS VHOME to "$VPOP" exit } } else { exception { # PULL USERS MAILFILTER IF PRESENT include $VHOME/Maildir/.mailfilter } exception { # LET VPOP HANDLE DELIVER # IN CASE OF CATCHALL, YOU DONT WANT TO DELIVER DIRECTLY TO A USERS VHOME to "$VPOP" exit } } exit