Qmail-LDAP
[Top] [All Lists]

Re: Maildrop and qmail-ldap

To: Roger Thomas <sniper@home.net.my>, qmail-ldap@qmail-ldap.org
Subject: Re: Maildrop and qmail-ldap
From: Robert Müller <rmueller@thinxsolutions.de>
Date: Sat, 06 Jan 2007 10:45:46 +0100
Delivered-to: sp-com-lists@consult.net
Delivered-to: qmail-ldap-list@securepoint.com
Delivered-to: mailing list qmail-ldap@qmail-ldap.org
Delivered-to: secretary for qmail-ldap@qmail-ldap.org
In-reply-to: <1168059630.459f2cee8c999@mail.home.net.my>
Mailing-list: contact qmail-ldap-help@qmail-ldap.org; run by ezmlm
References: <1168050182.459f08066cdcb@mail.home.net.my> <459F1905.90206@hexa.com.uy> <1168059630.459f2cee8c999@mail.home.net.my>
User-agent: Thunderbird 1.5 (X11/20051201)
Roger Thomas schrieb:
Quoting Gabriel_Cabillón <gcabillon@hexa.com.uy>:

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:
[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

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

<Prev in Thread] Current Thread [Next in Thread>