Konstantinos Tsakiltzidis
2018-Mar-02 16:10 UTC
Sieve filter doesn't respect mailbox separator
namespace separator is '.', this sieve script incorrectly tries to put the mail inside a mailbox rather that beside it, for example if the mailbox is named 'example', the mail will be put in the path 'example/.Spam' instead of 'example.Spam' require ["fileinto"]; if header :contains "X-Spam" "yes" { ? fileinto "Spam"; } # 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.21 (92477967) # OS: Linux 4.9.0-6-amd64 x86_64 Debian 9.1 ext4 lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes mail_debug = yes mail_location = maildir:/var/vmail/%d/%n 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 index ihave duplicate mime foreverypart extracttext 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 ? separator = . ? subscriptions = yes ? type = private } namespace modulus { ? list = children ? location = maildir:/var/vmail/%d/Public:INDEXPVT=~/public/indexes ? mailbox admin { ??? auto = subscribe ? } ? mailbox support { ??? auto = subscribe ? } ? mailbox telecoms { ??? auto = subscribe ? } ? prefix = Public. ? separator = . ? subscriptions = yes ? type = public } passdb { ? driver = pam } plugin { ? acl = vfile ? mail_log_events = flag_change ? mail_log_fields = box flags uid ? sieve = ~/dovecot.sieve ? sieve_before = /var/vmail/global.sieve ? sieve_dir = ~/sieve ? sieve_global_dir = /var/vmail/sieve } protocols = " imap lmtp sieve lmtp" service auth { ? unix_listener /var/spool/postfix/private/auth { ??? group = mail ??? mode = 0666 ??? user = postfix ? } ? unix_listener auth-userdb { ??? group = mail ??? mode = 0666 ??? user = vmail ? } } service imap-login { ? inet_listener imap { ??? port = 0 ? } } service lmtp { ? unix_listener /var/spool/postfix/private/dovecot-lmtp { ??? group = postfix ??? mode = 0600 ??? user = postfix ? } } service managesieve-login { ? inet_listener sieve { ??? port = 4190 ? } ? process_min_avail = 0 ? service_count = 1 ? vsz_limit = 64 M } service managesieve { ? process_limit = 1024 } ssl = required ssl_cert = </etc/ssl/certs/mail.crt ssl_key =? # hidden, use -P to show it userdb { ? driver = passwd } protocol imap { ? mail_max_userip_connections = 20 ? mail_plugins = " mail_log notify acl" ? passdb { ??? args = /etc/dovecot/dovecot-ldap-users.conf.ext ??? driver = ldap ??? name ? } ? userdb { ??? args = uid=vmail gid=mail home=/var/vmail/%d/%n ??? driver = static ??? name ? } } protocol lda { ? mail_plugins = " sieve acl" ? userdb { ??? args = /etc/dovecot/dovecot-ldap-users.conf.ext ??? driver = ldap ??? name ??? override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n ? } ? userdb { ??? args = /etc/dovecot/dovecot-ldap-groups.conf.ext ??? driver = ldap ??? name ??? override_fields = uid=vmail gid=mail home=/var/vmail/%d/Public/.%n mail=maildir:/var/vmail/%d/Public/.%n ? } } protocol lmtp { ? mail_plugins = " sieve acl" ? postmaster_address = postmaster at modulus.gr ? userdb { ??? args = /etc/dovecot/dovecot-ldap-users.conf.ext ??? driver = ldap ??? name ??? override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n ? } ? userdb { ??? args = /etc/dovecot/dovecot-ldap-groups.conf.ext ??? driver = ldap ??? name ??? override_fields = uid=vmail gid=mail home=/var/vmail/%d/Public/.%n mail=maildir:/var/vmail/%d/Public/.%n ? } } protocol doveadm { ? userdb { ??? args = /etc/dovecot/dovecot-ldap-users.conf.ext ??? driver = ldap ??? name ??? override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n ? } ? userdb { ??? args = /etc/dovecot/dovecot-ldap-groups.conf.ext ??? driver = ldap ??? name ??? override_fields = uid=vmail gid=mail home=/var/vmail/%d/Public/.%n mail=maildir:/var/vmail/%d/Public/.%n ? } } protocol sieve { ? mail_max_userip_connections = 10 ? managesieve_implementation_string = Dovecot Pigeonhole ? managesieve_logout_format = bytes=%i/%o ? managesieve_max_line_length = 65536 ? passdb { ??? args = /etc/dovecot/dovecot-ldap-users.conf.ext ??? driver = ldap ??? name ? } ? userdb { ??? args = uid=vmail gid=mail home=/var/vmail/%d/%n ??? driver = static ??? name ? } }
Jungersen, Danjel - Jungersen Grafisk ApS
2018-Mar-06 14:15 UTC
Sieve filter doesn't respect mailbox separator
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <title></title> <meta http-equiv="content-type" content="text/html;charset=utf-8"/> <meta http-equiv="Content-Style-Type" content="text/css"/> </head> <body> <div align="left"><font face="Arial" size="2"><span style=" font-size:10pt">On 2 Mar 2018 at 18:10, Konstantinos Tsakiltzidis wrote:</span></font></div> <div align="left"><font face="Arial" size="2"><span style=" font-size:10pt"><br /> </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> namespace separator is '.',</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> this sieve script incorrectly tries to put the mail inside a mailbox</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> rather that beside it, for example if the mailbox is named 'example',</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> the mail will be put in the path 'example/.Spam' instead of</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> 'example.Spam'</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> require ["fileinto"];</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> if header :contains "X-Spam" "yes" {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> fileinto "Spam";</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" size="2"><span style=" font-size:10pt">Could it be related to the fact that in one line you say "Junk" (In dovecot) and in another you say "Spam" (In sieve) ??</span></font></div> <div align="left"><font face="Arial" size="2"><span style=" font-size:10pt"><br /> </span></font></div> <div align="left"><font face="Arial" size="2"><span style=" font-size:10pt">//Danjel</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> # 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> # Pigeonhole version 0.4.21 (92477967)</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> # OS: Linux 4.9.0-6-amd64 x86_64 Debian 9.1 ext4</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> lda_mailbox_autocreate = yes</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> lda_mailbox_autosubscribe = yes</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail_debug = yes</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail_location = maildir:/var/vmail/%d/%n</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> managesieve_notify_capability = mailto</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> managesieve_sieve_capability = fileinto reject envelope </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> encoded-character vacation subaddress comparator-i;ascii-numeric</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> relational regex imap4flags copy include variables body enotify</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> environment mailbox date index ihave duplicate mime foreverypart</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> extracttext namespace inbox {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> inbox = yes</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> location =</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mailbox Drafts {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> special_use = \Drafts</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mailbox Junk {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> special_use = \Junk</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mailbox Sent {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> special_use = \Sent</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mailbox "Sent Messages" {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> special_use = \Sent</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mailbox Trash {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> special_use = \Trash</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> prefix =</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> separator = .</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> subscriptions = yes</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> type = private</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> namespace modulus {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> list = children</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> location = maildir:/var/vmail/%d/Public:INDEXPVT=~/public/indexes</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mailbox admin { auto = subscribe } mailbox support {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> auto = subscribe } mailbox telecoms { auto =</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> subscribe } prefix = Public. separator = . subscriptions</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> = yes type = public</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> passdb {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = pam</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> plugin {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> acl = vfile</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail_log_events = flag_change</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail_log_fields = box flags uid</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> sieve = ~/dovecot.sieve</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> sieve_before = /var/vmail/global.sieve</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> sieve_dir = ~/sieve</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> sieve_global_dir = /var/vmail/sieve</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> protocols = " imap lmtp sieve lmtp"</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> service auth {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> unix_listener /var/spool/postfix/private/auth {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> group = mail</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mode = 0666</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> user = postfix</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> unix_listener auth-userdb {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> group = mail</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mode = 0666</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> user = vmail</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> service imap-login {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> inet_listener imap {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> port = 0</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> service lmtp {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> unix_listener /var/spool/postfix/private/dovecot-lmtp {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> group = postfix</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mode = 0600</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> user = postfix</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> service managesieve-login {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> inet_listener sieve {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> port = 4190</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> process_min_avail = 0</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> service_count = 1</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> vsz_limit = 64 M</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> service managesieve {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> process_limit = 1024</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> ssl = required</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> ssl_cert = </etc/ssl/certs/mail.crt</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> ssl_key = # hidden, use -P to show it</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> userdb {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = passwd</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> protocol imap {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail_max_userip_connections = 20</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail_plugins = " mail_log notify acl"</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> passdb {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> args = /etc/dovecot/dovecot-ldap-users.conf.ext</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = ldap</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> name =</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> userdb {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> args = uid=vmail gid=mail home=/var/vmail/%d/%n</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = static</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> name =</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> protocol lda {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail_plugins = " sieve acl"</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> userdb {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> args = /etc/dovecot/dovecot-ldap-users.conf.ext</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = ldap</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> name =</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> } userdb { args = /etc/dovecot/dovecot-ldap-groups.conf.ext</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = ldap name = override_fields = uid=vmail</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> gid=mail home=/var/vmail/%d/Public/.%n </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail=maildir:/var/vmail/%d/Public/.%n</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> protocol lmtp {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail_plugins = " sieve acl"</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> postmaster_address = postmaster@modulus.gr</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> userdb {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> args = /etc/dovecot/dovecot-ldap-users.conf.ext</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = ldap</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> name =</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> } userdb { args = /etc/dovecot/dovecot-ldap-groups.conf.ext</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = ldap name = override_fields = uid=vmail</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> gid=mail home=/var/vmail/%d/Public/.%n </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail=maildir:/var/vmail/%d/Public/.%n</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> protocol doveadm {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> userdb {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> args = /etc/dovecot/dovecot-ldap-users.conf.ext</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = ldap</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> name =</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> } userdb { args = /etc/dovecot/dovecot-ldap-groups.conf.ext</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = ldap name = override_fields = uid=vmail</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> gid=mail home=/var/vmail/%d/Public/.%n </span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail=maildir:/var/vmail/%d/Public/.%n</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> protocol sieve {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> mail_max_userip_connections = 10</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> managesieve_implementation_string = Dovecot Pigeonhole</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> managesieve_logout_format = bytes=%i/%o</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> managesieve_max_line_length = 65536</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> passdb {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> args = /etc/dovecot/dovecot-ldap-users.conf.ext</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = ldap</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> name =</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> userdb {</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> args = uid=vmail gid=mail home=/var/vmail/%d/%n</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> driver = static</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> name =</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" color="#7f0000" size="2"><span style=" font-size:10pt">> }</span></font></div> <div align="left"><font face="Arial" size="2"><span style=" font-size:10pt"><br /> </span></font></div> <div align="left"> </div> </body> </html>
Konstantinos Tsakiltzidis
2018-Mar-08 17:37 UTC
Sieve filter doesn't respect mailbox separator
The problem seems to be my Public/.. mailboxes, and the home path of each one. This apparently is not a bug, just a very hard configuration detail. On 03/06/2018 04:15 PM, Jungersen, Danjel - Jungersen Grafisk ApS wrote:> On 2 Mar 2018 at 18:10, Konstantinos Tsakiltzidis wrote: > > > namespace separator is '.', > > this sieve script incorrectly tries to put the mail inside a mailbox > > rather that beside it, for example if the mailbox is named 'example', > > the mail will be put in the path 'example/.Spam' instead of > > 'example.Spam' > > > > require ["fileinto"]; > > if header :contains "X-Spam" "yes" { > >? ? fileinto "Spam"; > > } > Could it be related to the fact that in one line you say "Junk" (In > dovecot) and in another you say "Spam" (In sieve) ?? > > //Danjel > > > > > > > > # 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf > > # Pigeonhole version 0.4.21 (92477967) > > # OS: Linux 4.9.0-6-amd64 x86_64 Debian 9.1 ext4 > > lda_mailbox_autocreate = yes > > lda_mailbox_autosubscribe = yes > > mail_debug = yes > > mail_location = maildir:/var/vmail/%d/%n > > 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 index ihave duplicate mime foreverypart > > extracttext 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 > >? ? separator = . > >? ? subscriptions = yes > >? ? type = private > > } > > namespace modulus { > >? ? list = children > >? ? location = maildir:/var/vmail/%d/Public:INDEXPVT=~/public/indexes > >? ? mailbox admin { ??? auto = subscribe ? } ? mailbox support { > >? ??? auto = subscribe ? } mailbox telecoms { ??? auto > >? subscribe ? } ? prefix = Public. ? separator = . ? subscriptions > >? = yes ? type = public > > } > > passdb { > >? ? driver = pam > > } > > plugin { > >? ? acl = vfile > >? ? mail_log_events = flag_change > >? ? mail_log_fields = box flags uid > >? ? sieve = ~/dovecot.sieve > >? ? sieve_before = /var/vmail/global.sieve > >? ? sieve_dir = ~/sieve > >? ? sieve_global_dir = /var/vmail/sieve > > } > > protocols = " imap lmtp sieve lmtp" > > service auth { > >? ? unix_listener /var/spool/postfix/private/auth { > >? ??? group = mail > >? ??? mode = 0666 > >? ??? user = postfix > >? ? } > >? ? unix_listener auth-userdb { > >? ??? group = mail > >? ??? mode = 0666 > >? ??? user = vmail > >? ? } > > } > > service imap-login { > >? ? inet_listener imap { > >? ??? port = 0 > >? ? } > > } > > service lmtp { > >? ? unix_listener /var/spool/postfix/private/dovecot-lmtp { > >? ??? group = postfix > >? ??? mode = 0600 > >? ??? user = postfix > >? ? } > > } > > service managesieve-login { > >? ? inet_listener sieve { > >? ??? port = 4190 > >? ? } > >? ? process_min_avail = 0 > >? ? service_count = 1 > >? ? vsz_limit = 64 M > > } > > service managesieve { > >? ? process_limit = 1024 > > } > > ssl = required > > ssl_cert = </etc/ssl/certs/mail.crt > > ssl_key =? # hidden, use -P to show it > > userdb { > >? ? driver = passwd > > } > > protocol imap { > >? ? mail_max_userip_connections = 20 > >? ? mail_plugins = " mail_log notify acl" > >? ? passdb { > >? ??? args = /etc/dovecot/dovecot-ldap-users.conf.ext > >? ??? driver = ldap > >? ??? name > >? ? } > >? ? userdb { > >? ??? args = uid=vmail gid=mail home=/var/vmail/%d/%n > >? ??? driver = static > >? ??? name > >? ? } > > } > > protocol lda { > >? ? mail_plugins = " sieve acl" > >? ? userdb { > >? ??? args = /etc/dovecot/dovecot-ldap-users.conf.ext > >? ??? driver = ldap > >? ??? name > >? ??? override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n > >? } ? userdb { ??? args = /etc/dovecot/dovecot-ldap-groups.conf.ext > >? ??? driver = ldap ??? name = ??? override_fields = uid=vmail > >? gid=mail home=/var/vmail/%d/Public/.%n > > mail=maildir:/var/vmail/%d/Public/.%n > >? ? } > > } > > protocol lmtp { > >? ? mail_plugins = " sieve acl" > >? ? postmaster_address = postmaster at modulus.gr > >? ? userdb { > >? ??? args = /etc/dovecot/dovecot-ldap-users.conf.ext > >? ??? driver = ldap > >? ??? name > >? ??? override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n > >? } ? userdb { ??? args = /etc/dovecot/dovecot-ldap-groups.conf.ext > >? ??? driver = ldap ??? name = ??? override_fields = uid=vmail > >? gid=mail home=/var/vmail/%d/Public/.%n > > mail=maildir:/var/vmail/%d/Public/.%n > >? ? } > > } > > protocol doveadm { > >? ? userdb { > >? ??? args = /etc/dovecot/dovecot-ldap-users.conf.ext > >? ??? driver = ldap > >? ??? name > >? ??? override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n > >? } ? userdb { ??? args = /etc/dovecot/dovecot-ldap-groups.conf.ext > >? ??? driver = ldap ??? name = ??? override_fields = uid=vmail > >? gid=mail home=/var/vmail/%d/Public/.%n > > mail=maildir:/var/vmail/%d/Public/.%n > >? ? } > > } > > protocol sieve { > >? ? mail_max_userip_connections = 10 > > managesieve_implementation_string = Dovecot Pigeonhole > >? ? managesieve_logout_format = bytes=%i/%o > >? ? managesieve_max_line_length = 65536 > >? ? passdb { > >? ??? args = /etc/dovecot/dovecot-ldap-users.conf.ext > >? ??? driver = ldap > >? ??? name > >? ? } > >? ? userdb { > >? ??? args = uid=vmail gid=mail home=/var/vmail/%d/%n > >? ??? driver = static > >? ??? name > >? ? } > > } >-------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20180308/30df4309/attachment-0001.html>