Sendmail

Sendmail:如何自動創建垃圾郵件文件夾?

  • November 10, 2015

我有一個郵件伺服器(sendmail+dovecot+procmail+spamassassin)工作正常,對於普通郵件,對於垃圾郵件,我想為每個使用者創建一個名為“Spam”的文件夾並將所有垃圾郵件放在那裡。我這樣配置 procmailrc

:0:
* ^X-Spam-Status: Yes
Spam

重新啟動 sendmail,但沒有創建垃圾郵件文件夾並且郵件發送到…dev/null?如何自動創建垃圾郵件文件夾?

在 procmail 上找到的解決方案

DEFAULT=/var/spool/mail/$LOGNAME/new
ORGMAIL=/var/spool/mail/$LOGNAME
MAILDIR=/var/spool/mail/$LOGNAME
DELIVER="/usr/lib/dovecot/deliver -d $LOGNAME"
LOGFILE=/root/procmail.log
VERBOSE=yes

# deliver spam to spam folder

:0
* ^X-Spam-Status: Yes
.Spam/

在鴿舍上

inbox = yes
 #mailbox name {
   # auto=create will automatically create this mailbox.
   # auto=subscribe will both create and subscribe to the mailbox.
   #auto = no

   # Space separated list of IMAP SPECIAL-USE attributes as specified by
   # RFC 6154: \All \Archive \Drafts \Flagged \Junk \Sent \Trash
   #special_use =
 #}

 # These mailboxes are widely used and could perhaps be created automatically:
 mailbox Drafts {
   special_use = \Drafts
   auto = create
 }
 mailbox Spam {
   special_use = \Junk
   auto = subscribe
 }
 mailbox Trash {
   special_use = \Trash
   auto = create
 }

引用自:https://unix.stackexchange.com/questions/241963