Roger Thomas schrieb:
Quoting Gabriel_Cabillón <[EMAIL PROTECTED]>:

Roger Thomas wrote:
I have modified slightly the wiki instruction at
http://www.qmail-ldap.org/wiki/Full_Installation_Guide_-_Maildrop
because I want Maildrop to create a folder named Spam if no such
folder exists:
-- 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 $HOME/Maildir/.Spam`
          `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, Spam 'folder' is created (when I received a spam
email), BUT IT IS NOT A FOLDER. It is a file:
[EMAIL PROTECTED] 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

If I were to change the line from
`/usr/local/bin/maildirmake $HOME/Maildir/.Spam`
to
`/var/qmail/bin/maildirmake $HOME/Maildir/.Spam`
makes no difference.

I am using Courier-imap. What could have I possibly missed? Please
help.
TIA.


---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------
from maildirmake man page:

  -f folder
     do not create a maildir, but create a folder in an existing
maildir.


...so the command would be:
/usr/local/bin/maildirmake -f Spam $HOME/Maildir

Gabriel



Strange but same result, Spam was created as file. 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?

--
roger


---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------

I'm using exactly this construct within my maildroprc - and it works fine for me. Here is again the line:

if(....
{
`/usr/bin/maildirmake -f Spam $HOME/$HOST/$USER/Maildir/`
}

The $HOST/$USER I need because it's a virtual environment.
I also had some problems with maildroprc in the beginning, resulting in maildrop doing some strange, not expected things. Problem was most probably due to invisible character set issues, caused by copying the main structure from a web page. After some tries with iconv etc. I decided to retype it completely in 'vi' - this finally helped me out.

Regards,

Robert

Reply via email to