我已经配置了一个邮件服务器(spamassassin+procmail+sendmail+dovecot),我希望所有垃圾邮件都重定向到垃圾邮件文件夹,我设置了/etc/procmail
DEFAULT=/var/spool/mail/$LOGNAME/new
ORGMAIL=/var/spool/mail/$LOGNAME
MAILDIR=/var/spool/mail/$LOGNAME
# 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 = create
}
mailbox Trash {
special_use = \Trash
auto = create
}
当我发送一封垃圾邮件进行测试时,它不会在 thunderbird 上自动创建文件夹,并且我看到该文件夹(存在于系统中)具有 root 权限而不是用户权限,当然,如果在另一封邮件发送后执行 chown 则会返回到原始权限(root!)
答案1
DROPPRIVS=yes
在开始处添加/etc/procmailrc
man procmailrc
:
DROPPRIVS 如果设置为“yes”,procmail 将放弃其可能拥有的所有权限(suid 或 sgid)。这仅在您想要保证代表收件人执行 /etc/procmailrc 文件的下半部分时才有用。
答案2
找到解决方案:
mailbox Spam {
special_use = \Junk
auto = create
}
成为
mailbox Spam {
special_use = \Junk
auto = subscribe
}
现在它起作用了