Morvan Daniel Müller schrieb am 20.11.2007 13:49:
How I say to postfix to direct subject=[SPAM ] xxxxxx (mark by spamassassin) to ~home\mail\SPAM (imap folder) I'm using Mailbox no Maildir. Postfix deliver to /var/mail/$user and Dovecot read from mail_location = mbox:~/mail:INBOX=/var/mail/%u

Procmail can do this, not postfix. Use this entry in postfix' main.cf to let procmail deliver your mail:

mailbox_command = /usr/bin/procmail -a "$USER"

Then use a procmail recipe like this to filter spam into imap folders. It does not check the subject line, but simply the standard X-Spam-xxxx headers created by Spamassassin:

# Spam via SpamAssassin
:0
*^X-Spam-Flag:.*YES
{
  :0
  *^X-Spam-Status:.*autolearn=no
  {
    :0
    *!^X-Spam-Status:.*BAYES_99
    mail/spam/learn

  }

  :0
  *^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
  mail/spam/sure

  :0
  mail/spam/probable

}

This recipe moves spam that was not autolearned into mail/spam/learn, mail with score>=10 into mail/spam/sure and the rest into mail/spam/probable (which is spam with score between 5 and 10). It depends on the X-Spam-Level header as well, you must not disable that header in local.cf. These folders are in the user's home directories, while the main inbox still resides in /var/mail/$USER.

I need to change my config to use MAILDIR?

Not required for postfix+procmail+dovecot+squirrelmail. This combination is running here very well on a Fedora 7 system and worked since Fedora Core 3 I think.

How I say to squirrelmail to see the SPAM folder without create one by one in each squirrelmail user profile?

As soon as procmail moves the first spam into one of the imap spam folders, that folder is automatically created. It should then immediately be available in squirrelmail.

Alex

Reply via email to