I'm running postfix + dovecot + dovecot-pigeonhole
on my CentOS-7 home server.
I would like spam to finish up in ~/Maildir/.Spam/ .
Spam is being marked, but is not separated -
it ends up with all the other email in ~/Maildir/cur/ .
Evidently there is some step I have omitted to take.
I give the output of "sudo doveconf -n" below.
The file ~/.dovecot.sieve reads:
------------------------------
# Sieve Filter
require
["fileinto","regex","envelope","vacation"];
if header :contains "X-Spam-Flag" "YES" {
fileinto "/home/tim/Maildir/.Spam/";
}
------------------------------
When I run "sudo systemctl restart dovecot"
I see the line
Jul 27 18:54:23 alfred dovecot: master: Dovecot v2.2.10 starting up
for imap, pop3, lmtp, sieve (core dumps disabled)
in /var/log/maillog
Output of "sudo doveconf -n > dovecot.conf"
------------------------------
# 2.2.10: /etc/dovecot/dovecot.conf
# OS: Linux 3.10.0-123.4.4.el7.x86_64 x86_64 CentOS Linux release 7.0.1406
(Core)
listen = *
mail_debug = yes
mail_location = maildir:~/Maildir
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character
vacation subaddress
comparator-i;ascii-numeric relational regex imap4flags copy include variables
body enotify
environment mailbox date ihave
mbox_write_locks = fcntl
namespace inbox {
inbox = yes
location mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix }
passdb {
driver = pam
}
plugin {
sieve = ~/.dovecot.sieve
sieve_dir = ~/sieve
}
protocols = imap pop3 lmtp sieve
ssl = required
ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_key = </etc/pki/dovecot/private/dovecot.pem
userdb {
driver = passwd
}
protocol lmtp {
mail_plugins = " sieve"
}
protocol lda {
mail_plugins = " sieve"
}
------------------------------
Any advice or suggestions gratefully received.
On 07/27/2014 05:08 PM, Timothy Murphy wrote:> I'm running postfix + dovecot + dovecot-pigeonhole > on my CentOS-7 home server. > I would like spam to finish up in ~/Maildir/.Spam/ . > Spam is being marked, but is not separated - > it ends up with all the other email in ~/Maildir/cur/ . > Evidently there is some step I have omitted to take. > > I give the output of "sudo doveconf -n" below. > The file ~/.dovecot.sieve reads: > ------------------------------ > # Sieve Filter > > require ["fileinto","regex","envelope","vacation"]; > > if header :contains "X-Spam-Flag" "YES" { > fileinto "/home/tim/Maildir/.Spam/";^^^^^^^^^^^^^^^^^^^> } > ------------------------------Check the example in Dovecot wiki again: http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples#Direct_filtering_using_message_header It uses: fileinto "Spam";> > When I run "sudo systemctl restart dovecot" > I see the line > Jul 27 18:54:23 alfred dovecot: master: Dovecot v2.2.10 starting up > for imap, pop3, lmtp, sieve (core dumps disabled) > in /var/log/maillog >You can enable 'mail_debug=yes" and Dovecot will log some interesting information, for example about your fileinto "/full/path/to/.maildir". Regards, Pascal -- The trapper recommends today: f007ba11.1420819 at localdomain.org
Timothy Murphy wrote on 28.07.2014 00:08:> I'm running postfix + dovecot + dovecot-pigeonhole > on my CentOS-7 home server. > I would like spam to finish up in ~/Maildir/.Spam/ . > Spam is being marked, but is not separated - > it ends up with all the other email in ~/Maildir/cur/ . > Evidently there is some step I have omitted to take. > > I give the output of "sudo doveconf -n" below. > The file ~/.dovecot.sieve reads: > ------------------------------ > # Sieve Filter > > require ["fileinto","regex","envelope","vacation"]; > > if header :contains "X-Spam-Flag" "YES" { > fileinto "/home/tim/Maildir/.Spam/"; > } > ------------------------------ > > When I run "sudo systemctl restart dovecot" > I see the line > Jul 27 18:54:23 alfred dovecot: master: Dovecot v2.2.10 starting up > for imap, pop3, lmtp, sieve (core dumps disabled) > in /var/log/maillog > > Output of "sudo doveconf -n > dovecot.conf" > ------------------------------ > # 2.2.10: /etc/dovecot/dovecot.conf > # OS: Linux 3.10.0-123.4.4.el7.x86_64 x86_64 CentOS Linux release 7.0.1406 (Core) > listen = * > mail_debug = yes > mail_location = maildir:~/Maildir > managesieve_notify_capability = mailto > managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress > comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify > environment mailbox date ihave > mbox_write_locks = fcntl > namespace inbox { > inbox = yes > location > mailbox Drafts { > special_use = \Drafts > } > mailbox Junk { > special_use = \Junk > } > mailbox Sent { > special_use = \Sent > } > mailbox "Sent Messages" { > special_use = \Sent > } > mailbox Trash { > special_use = \Trash > } > prefix > } > passdb { > driver = pam > } > plugin { > sieve = ~/.dovecot.sieve > sieve_dir = ~/sieve > } > protocols = imap pop3 lmtp sieve > ssl = required > ssl_cert = </etc/pki/dovecot/certs/dovecot.pem > ssl_key = </etc/pki/dovecot/private/dovecot.pem > userdb { > driver = passwd > } > protocol lmtp { > mail_plugins = " sieve" > } > protocol lda { > mail_plugins = " sieve" > } > ------------------------------ > > Any advice or suggestions gratefully received.Simply: require ["fileinto"]; if anyof (header :contains "X-Spam-Flag" "YES") { fileinto "Spam"; stop; }
Timothy Murphy wrote:> I'm running postfix + dovecot + dovecot-pigeonhole > on my CentOS-7 home server. > I would like spam to end up in ~/Maildir/.Spam/ . > Spam is being marked, but is not separated - > it ends up with all the other email in ~/Maildir/cur/ . > Evidently there is some step I have omitted to take.You need to pass your mail through dovecot-lda or lmtp in order to make the SIEVE filters work. Postfix may not write directly to ~/Maildir/cur/. Regards Daniel
Apparently Analagous Threads
- pigeonhole-0.4.14
- Pigeonhole implicit keep gets unfiltered message
- Case sensitive problem for vacation with dovecot lmtp pigeonhole
- Potential bug report: Cannot use ":args" option via Pigeonhole Sieve pipe plugin
- Released Pigeonhole v0.4.7.rc1 for Dovecot v2.2.16.rc1