Re: [maildropl] Create folders if not exist in IMAP
Brought to you by:
mrsam
From: Jay L. <jl...@pb...> - 2005-12-02 13:46:01
|
Malaney J. Hill said: > Is it possible for maildrop to create folder in my users account if the > folder does not exist? > > i.e. > > if (! -d $HOME/$DEFAULT/.Spam/) { > exception { // create $HOME/$DEFAULT/.Spam/ > } > } > > > Right now when I create a new account, if SA determines that a message > contains spam my rule says to place it in the .Spam folder. But if that > folder does not exist it goes right to the users inbox. If maildrop is > not the tool for this then what is? Here's what I use to create, subscribe and deliver to a Spam folder: if (/^X-Spam-Status: *Yes/:h) { #Create SPAM IMAP folder if they don't have one `test -d $MAILDIR/.Spam` if( $RETURNCODE == 1 ) { `/usr/lib/courier/bin/maildirmake -f Spam $MAILDIR` `echo INBOX.Spam >> $MAILDIR/courierimapsubscribed` } exception { to "$MAILDIR/.Spam/" } } -- Jay Lee Network / Systems Administrator Information Technology Dept. Philadelphia Biblical University -- |