I want Maildrop to create a folder named Spam if no such folder exists (upon
receiving a mail that is tagged as Spam). So I created a maildroprc file like
the following:
-- start of my maildroprc script --
import HOME
import MAILDIRQUOTA
XBOUNCE="| bouncesaying 'Sorry, no mailbox here by that name.'"
if (/^X-Spam-Flag: Yes/)
{
`test -d $HOME/Maildir/.Spam`
if( $RETURNCODE != 0 )
{
`/usr/local/bin/maildirmake -f Spam $HOME/Maildir`
`echo INBOX.Spam >> $DEFAULT/courierimapsubscribed`
}
to "$HOME/Maildir/.Spam"
}
if ( $HOME eq "" )
{
to "$XBOUNCE"
}
else
{
exception {
include "$HOME/.mailfilter"
}
exception {
to "$HOME/Maildir"
}
}
to "$HOME/Maildir"
-- end of maildroprc --
Problem is, upon receiving a spam mail, maildrop created a file, NOT A FOLDER.
[root@maildevel root]# ls -al /home/example.com/roger/Maildir/
total 48
drwx------ 9 vmail vmail 4096 Jan 6 10:22 .
drwx------ 3 vmail vmail 4096 Jan 6 10:21 ..
drwx------ 2 vmail vmail 4096 Jan 6 10:21 courierimapkeywords
-rw-r--r-- 1 vmail vmail 36 Jan 6 10:21 courierimapsubscribed
-rw-r--r-- 1 vmail vmail 15 Jan 6 10:21 courierimapuiddb
drwx------ 2 vmail vmail 4096 Jan 6 10:21 cur
drwx------ 5 vmail vmail 4096 Jan 6 10:21 .Drafts
drwx------ 2 vmail vmail 4096 Jan 6 10:21 new
drwx------ 5 vmail vmail 4096 Jan 6 10:21 .Sent
-rw------- 1 vmail vmail 3801 Jan 6 10:22 .Spam
drwx------ 2 vmail vmail 4096 Jan 6 10:22 tmp
drwx------ 6 vmail vmail 4096 Jan 6 10:21 .Trash
I am using Courier-imap. But if I were to run that command from shell:
# /usr/local/bin/maildirmake -f Spam /home/example.com/roger/Maildir
that would CORRECTLY created Spam as a folder. Wonder why Maildrop does not do
that thru maildroprc ? Any idea?
---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/