[LUGOS] Maildrop: Unable to open mailbox

Tomaž Zupan tomaz.zupan at orpo.si
Thu Jun 30 08:47:24 CEST 2005


Dne četrtek 30. junija 2005 06:37 je miha at furlan.biz napisal(a):
> Maildrop v osnovi ne podpira avtomatskega ustvarjanja Maildirov, lahko pa
> uporabiš popraviš kodo maildropa, da jih bo ustvarjal. Pogooglaj za
> narejene patche.
>
Pred časom je na maildrop listi  
Joaquim Laureano <laureano at lusostar.com> objavil tole maildroprc skripto, ki 
sama naredi Maildire. Sam je še nisem preizkusil...

VHOME="/path to the vhosts dir/vhosts"
ACCOUNT=`echo "$LOGNAME" | cut -d@ -f1`
USERDOMAIN=`echo "$LOGNAME" | cut -d@ -f2`
VMAIL_LOGFILE="/path to the vhosts dir/maildrop-log.txt"


`test -d "$VHOME/$USERDOMAIN/$ACCOUNT"`
if( $RETURNCODE == 1 )
{
    MESSAGE_DATE = `date`
    `echo CREATION DATE:    "$MESSAGE_DATE" >> $VMAIL_LOGFILE`
    `echo EMAIL DIRECTORY:  "$VHOME/$USERDOMAIN/$ACCOUNT" >>
$VMAIL_LOGFILE`
    `echo USER EMAIL LOGIN: "$LOGNAME" >> $VMAIL_LOGFILE`
    `echo USER QUOTA SIZE:  "$MAILDIRQUOTA" >> $VMAIL_LOGFILE`
    `echo " " >> $VMAIL_LOGFILE`

    `test -d "$VHOME/$USERDOMAIN"`
    if( $RETURNCODE == 1 )
    {
        `echo CREATING DIRECTORY: "$VHOME/$USERDOMAIN" >>
$VMAIL_LOGFILE`
        `mkdir -p "$VHOME/$USERDOMAIN"`
        `echo " " >> $VMAIL_LOGFILE`
    }

    `/usr/local/courier/bin/maildirmake "$VHOME/$USERDOMAIN/$ACCOUNT"`
    `/usr/local/courier/bin/maildirmake -f Sent
"$VHOME/$USERDOMAIN/$ACCOUNT"`
    `echo INBOX.Sent >>
$VHOME/$USERDOMAIN/$ACCOUNT/courierimapsubscribed`
    `/usr/local/courier/bin/maildirmake -f Trash
"$VHOME/$USERDOMAIN/$ACCOUNT"`
    `echo INBOX.Trash >>
$VHOME/$USERDOMAIN/$ACCOUNT/courierimapsubscribed`
    `/usr/local/courier/bin/maildirmake -q "$MAILDIRQUOTA"S
"$VHOME/$USERDOMAIN/$ACCOUNT"`
    `touch $VHOME/$USERDOMAIN/$ACCOUNT/courierimapuiddb`
    `mkdir -p "$VHOME/$USERDOMAIN/$ACCOUNT/courierimapkeywords"`
}

if ( $SIZE < 26144 )
{
    exception {
        #xfilter "/usr/bin/spamassassin"
        xfilter "/usr/bin/spamc"
    }
}

if (/^X-Spam-Flag: *NO/)
{
    exception {
        `echo X-Spam-Flag=NO >> /tmp/maildrop`
    }

    exception {
        to "$VHOME/$USERDOMAIN/$ACCOUNT/Maildir"
        cc "|/usr/bin/sa-learn --single --ham"
    }
}
else
{
    exception {
        `echo X-Spam-Level=YES >> /tmp/maildrop`
    }

    if ( /^X-Spam-Level: *-----.*$/ )
    {
        exception {
            `echo X-Spam-Level=SPAM >> /tmp/maildrop`
        }

        if( test -d $VHOME/$USERDOMAIN/$ACCOUNT/.Spam )
        {
            `maildirmake -f Spam $VHOME/$USERDOMAIN/$ACCOUNT`
            `echo INBOX.Spam >>
$VHOME/$USERDOMAIN/$ACCOUNT/courierimapsubscribed`
        }

        exception {
             to "$VHOME/$USERDOMAIN/$ACCOUNT/.Spam"
        }
        cc "|/usr/bin/sa-learn --single --spam"
    }

    if ( /^X-Spam-Level: *-.*$/ )
    {
        `test -d $VHOME/$USERDOMAIN/$ACCOUNT/.AssumedSpam`
        if( $RETURNCODE == 1 )
        {
            `maildirmake -f AssumedSpam $VHOME/$USERDOMAIN/$ACCOUNT`
            `echo INBOX.AssumedSpam >>
$VHOME/$USERDOMAIN/$ACCOUNT/courierimapsubscribed`
        }

        exception {
            to "$VHOME/$USERDOMAIN/$ACCOUNT/.AssumedSpam"
        }
    }
}


-- 
Tomaž Zupan


More information about the lugos-list mailing list