> > I thought about this patch, too... However, I've planned to 
> implement it
> outside of vpopmail. Now I think that better place will be in vpopmail
> itself, thanks for idea...
> >

You could do it quite simply in a mailfilter:

Eg. My Spam mailfilter creates a SPAM folder if it does not already exist, then 
delivers any messages marked as spam to the new dir:

if ((/^X-Spam-Flag:.*YES/))
{
   `test -d ./Maildir/.SPAM`
   if( $RETURNCODE == 1 )
   {
   `maildirmake ./Maildir/.SPAM;chown -R vpopmail.vchkpw ./Maildir/.SPAM`
   `/home/vpopmail/subImapSpam.sh ./`
   }
   to "./Maildir/.SPAM/"
}

to "./Maildir/"
~

/home/vpopmail/subImapSpam.sh:

#!/bin/bash
IMAP="$1/Maildir/courierimapsubscribed"
if [ -f "$IMAP" ]; then
        CHECK=`cat "$1/Maildir/courierimapsubscribed" | grep "INBOX.SPAM"`
        if [ "$CHECK" == "" ]; then
                echo "INBOX.SPAM" >> $IMAP
        fi
else
        NEW="INBOX\nINBOX.Sent\nINBOX.Trash\nINBOX.Drafts\nINBOX.SPAM"

        echo -e $NEW > $IMAP
        chown vpopmail.vchkpw $IMAP
        chmod 644 $IMAP
fi
~

HTH,
MB

> >
> > -- 
> > Alex.
> >
> >
> 
> 
> 
> 

Reply via email to