Hi There!
I configured my server with Postfix and Spamassassin to flag incoming mails as spam an it works perfectly, Now, I need to move all the new and existing incoming Spam flagged mails to a new directory called Spam, Not the Junk, So I made these steps:
Dovecot Pigeonhole
dnf install dovecot-pigeonhole
Spamassassin – [/etc/mail/spamassassin/local.cf]
required_hits 5
report_safe 0
required_score 5
rewrite_header Subject [SPAM]
Postfix
# ------------- main.cf -------------
spamassassin_destination_recipient_limit = 1
# ------------- master.cf -------------
smtp inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes -o content_filter=spamassassin
spamassassin unix - n n - - pipe flags=R user=MY_USER_ID argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
Dovecot
# ------------- 20-lmtp.conf -------------
protocol lmtp {
# Space separated list of plugins to load (default is global mail_plugins).
mail_plugins = $mail_plugins sieve
}
#------------- 90-sieve.conf -------------
sieve_default = /etc/dovecot/sieve/default.sieve
#------------- Create new file: /etc/dovecot/sieve/default.sieve -------------
require ["envelope", "fileinto", "mailbox"];
if header :contains "X-Spam-Flag" "YES"
{
fileinto :create "Spam";
stop;
}
I tried to create a new Spam mailbox in 15-mailboxes.conf, But it the Dovecot didn’t start.
#------------- 15-mailboxes.conf -------------
namespace inbox {
# These mailboxes are widely used and could perhaps be created automatically:
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Trash {
special_use = \Trash
}
# This is WRONG -- Dovecot Won't Start
mailbox Spam {
special_use = \Spam
}
What I missed!?
Thank You