OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: [Postfix-Users] Junk & Draft Directory

From: mouss (usebsdfree.fr)
Date: Sun Mar 19 2006 - 04:48:03 CST


Num ber a écrit :
> It's still me :-p
>
> I have a little question (still one lol) about Postfix and Maildiremake.
>
> When a user receive a mail, postfix create "INBOX","Sent" and "Trash"
> automatically.

These are created by your MUA (or call it "mail reader").

> But i need to have Junk (For Spam and Virus) and Draft..

Draft should also be created by the MUA.

To create the Junk folder, choose among:
- manually create it in your MUA.
- add it when you create the account.
- create it at delivery time if using an external MDA (maildrop, procmail).

in the last 2 cases, you may want to auto-subscribe the folder. check
your imap server docs for that. otherwise, subscribe using the MUA.

>
> It's possibel to create the folder at the same time that other ?
> Or i need to do that with a php script ?
>
> I don't see anything on the Postfix Doc (And on google with postfix+junk
> draft+maildirmake) ...
>
> And to post the spam to Junk, i'm need maildrop or Procmail?
> I have see the filter in the doc (body_check, ...) but they can move the
> mail ?

The "standard" way is to use maildrop or procmail.

Before you ask, here is an example with maildrop.

[maildroprc]
...
maildirmake=/path/to/maildirmake
MAILDIR=$DEFAULT
JUNK_FOLDER=.Junk

_JUNK_DEST=$MAILDIR/$JUNK_FOLDER/

#automatically create the Junk folder
`test -d $_JUNK_DEST`
if ($RETURNCODE != 0 )
{
        `$maildirmake $_JUNK_DEST`
        # auto subscribe. the following works for courier-imap
        #`echo INBOX.Junk >> $MAILDIR/courierimapsubscribed`
}
...
if (/^X-Spam-Flag:\s*YES/)
{
    exception {
         to "$_JUNK_DEST";
    }
}