<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi,</p>
<p>I have a problem with storing messages into a Spam folder by
dovecot. Log says that message was stored into Spam mailbox but
when I check there is no message in users's Spam mailbox.</p>
<p>cat /var/log/mail.log | grep sieve | grep Spam : </p>
<p><b>Feb 17 05:09:11 mailserver dovecot: lda(user@domain): sieve:
msgid=<a class="moz-txt-link-rfc2396E"
href="mailto:b599df639ffa4d20f6e8d2bcff791286@somedomain.pl"><b599df639ffa4d20f6e8d2bcff791286@somedomain.pl></a>:
stored mail into mailbox 'Spam'</b><br>
</p>
<p> <br>
</p>
<p>Where are these messages if not in the Spam folder where they
should be? /var/vmail/domain/user/Maildir/.Spam/cur/</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><b> dovecot -n</b><br>
# 2.2.22 (fe789d2): /etc/dovecot/dovecot.conf<br>
# Pigeonhole version 0.4.13 (7b14904)<br>
# OS: Linux 4.4.0-104-generic x86_64 Ubuntu 16.04.3 LTS ext4<br>
auth_gssapi_hostname = mailserver.belpol.local<br>
auth_krb5_keytab = /etc/dovecot/dovecot.keytab<br>
auth_mechanisms = gssapi plain<br>
first_valid_gid = 117<br>
first_valid_uid = 111<br>
listen = *<br>
log_timestamp = "%Y-%m-%d %H:%M:%S "<br>
mail_gid = ebox<br>
mail_home = /var/vmail/%d/%u<br>
mail_location = maildir:/var/vmail/%d/%u/Maildir<br>
mail_uid = ebox<br>
managesieve_notify_capability = mailto<br>
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 index ihave duplicate mime foreverypart
extracttext<br>
namespace inbox {<br>
inbox = yes<br>
location =<br>
mailbox Drafts {<br>
auto = subscribe<br>
special_use = \Drafts<br>
}<br>
mailbox Sent {<br>
auto = subscribe<br>
special_use = \Sent<br>
}<br>
mailbox "Sent Messages" {<br>
auto = no<br>
special_use = \Sent<br>
}<br>
mailbox Spam {<br>
auto = create<br>
special_use = \Junk<br>
}<br>
mailbox Trash {<br>
auto = subscribe<br>
special_use = \Trash<br>
}<br>
prefix =<br>
separator = /<br>
subscriptions = yes<br>
}<br>
passdb {<br>
args = /etc/dovecot/dovecot-ldap.conf<br>
driver = ldap<br>
}<br>
plugin {<br>
quota = maildir:User quota<br>
quota_rule = *:storage=0<br>
sieve = /var/vmail/%Ld/%Ln/sieve-script<br>
sieve_before = /var/vmail/sieve/default.sieve<br>
sieve_default = /var/vmail/sieve/default.sieve<br>
sieve_dir = /var/vmail/%Ld/%Ln<br>
sieve_global_path = /var/vmail/sieve/default.sieve<br>
sieve_storage = /var/vmail/%Ld/%Ln<br>
}<br>
protocols = pop3 imap sieve<br>
service auth {<br>
executable = /usr/lib/dovecot/auth<br>
unix_listener /var/spool/postfix/private/auth {<br>
group = postfix<br>
mode = 0660<br>
user = postfix<br>
}<br>
unix_listener auth-master {<br>
group = ebox<br>
mode = 0600<br>
user = ebox<br>
}<br>
}<br>
service imap-login {<br>
inet_listener imap {<br>
address = *<br>
port = 143<br>
}<br>
inet_listener imaps {<br>
address = *<br>
port = 993<br>
}<br>
}<br>
service lmtp {<br>
unix_listener /var/spool/postfix/private/dovecot-lmtp {<br>
group = postfix<br>
mode = 0666<br>
user = postfix<br>
}<br>
}<br>
service managesieve-login {<br>
inet_listener sieve {<br>
port = 4190<br>
}<br>
}<br>
service pop3-login {<br>
inet_listener pop3 {<br>
port = 110<br>
}<br>
inet_listener pop3s {<br>
port = 995<br>
}<br>
}<br>
ssl_cert = </etc/dovecot/private/dovecot.pem<br>
ssl_key = </etc/dovecot/private/dovecot.pem<br>
userdb {<br>
args = /etc/dovecot/dovecot-ldap.conf<br>
default_fields = uid=111 gid=117<br>
driver = ldap<br>
}<br>
protocol imap {<br>
mail_max_userip_connections = 20<br>
mail_plugins = quota imap_quota<br>
}<br>
protocol pop3 {<br>
mail_plugins = quota<br>
}<br>
protocol lda {<br>
auth_socket_path = /var/run/dovecot/auth-master<br>
mail_plugins = sieve quota<br>
postmaster_address = postmaster<br>
}<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><b>default.sieve:</b></p>
<p>require ["fileinto"];<br>
# rule:[SPAM]<br>
if header :contains "X-Spam-Flag" "YES" {<br>
fileinto "Spam";<br>
}<br>
if header :contains "subject" ["***UNCHECKED***", "SPAM"] {<br>
fileinto "Spam";<br>
}<br>
<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>