Sieve filter doesn't respect mailbox separator

Jungersen, Danjel - Jungersen Grafisk ApS
2018-03-06T14:15:12Z

<!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">

<meta http-equiv="content-type"
content="text/html;charset=utf-8"/>
<meta http-equiv="Content-Style-Type"
content="text/css"/>


<font face="Arial"
size="2">On 2 Mar
2018 at 18:10, Konstantinos Tsakiltzidis
wrote:
<font face="Arial"
size="2">

<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> namespace separator is
'.',
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> this sieve script incorrectly tries to put the mail
inside a mailbox
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> rather that beside it, for example if the mailbox
is named 'example',
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> the mail will be put in the path
'example/.Spam' instead of
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>
'example.Spam'
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> require
["fileinto"];
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> if header :contains "X-Spam"
"yes" {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    fileinto
"Spam";
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
size="2">Could it be
related to the fact that in one line you say "Junk" (In dovecot) and
in another you
say "Spam" (In sieve) ??
<font face="Arial"
size="2">

<font face="Arial"
size="2"><span style="
font-size:10pt">//Danjel
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> # 2.2.33.2 (d6601f4ec):
/etc/dovecot/dovecot.conf
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> # Pigeonhole version 0.4.21
(92477967)
<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
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> lda_mailbox_autocreate =
yes
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> lda_mailbox_autosubscribe =
yes
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> mail_debug =
yes
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> mail_location =
maildir:/var/vmail/%d/%n
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> managesieve_notify_capability =
mailto
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> managesieve_sieve_capability = fileinto reject
envelope
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> encoded-character vacation subaddress
comparator-i;ascii-numeric
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> relational regex imap4flags copy include variables
body enotify
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> environment mailbox date index ihave duplicate mime
foreverypart
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> extracttext namespace inbox
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    inbox =
yes
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> location =
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mailbox Drafts
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      special_use =
\Drafts
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mailbox Junk
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      special_use =
\Junk
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mailbox Sent
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      special_use =
\Sent
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mailbox "Sent Messages"
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      special_use =
\Sent
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mailbox Trash
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      special_use =
\Trash
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> prefix =
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    separator =
.
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    subscriptions =
yes
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    type =
private
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> namespace modulus
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    list =
children
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    location =
maildir:/var/vmail/%d/Public:INDEXPVT=~/public/indexes
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mailbox admin {     auto = subscribe   }
mailbox support {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      auto = subscribe   }   mailbox telecoms {
auto =
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>  subscribe   }   prefix = Public.   separator = .
subscriptions
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>  = yes   type =
public
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> passdb {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    driver =
pam
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> plugin {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    acl =
vfile
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mail_log_events =
flag_change
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mail_log_fields = box flags
uid
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    sieve =
~/dovecot.sieve
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    sieve_before =
/var/vmail/global.sieve
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    sieve_dir =
~/sieve
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    sieve_global_dir =
/var/vmail/sieve
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> protocols = " imap lmtp sieve
lmtp"
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> service auth
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    unix_listener /var/spool/postfix/private/auth
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      group =
mail
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      mode =
0666
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      user =
postfix
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    unix_listener auth-userdb
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      group =
mail
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      mode =
0666
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      user =
vmail
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> service imap-login
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    inet_listener imap
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> port = 0
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> service lmtp
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    unix_listener
/var/spool/postfix/private/dovecot-lmtp {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      group =
postfix
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      mode =
0600
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      user =
postfix
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> service managesieve-login
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    inet_listener sieve
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      port =
4190
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    process_min_avail =
0
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    service_count =
1
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    vsz_limit = 64
M
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> service managesieve
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    process_limit =
1024
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> ssl =
required
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> ssl_cert =
</etc/ssl/certs/mail.crt
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> ssl_key =  # hidden, use -P to show
it
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> userdb {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    driver =
passwd
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> protocol imap
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mail_max_userip_connections =
20
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mail_plugins = " mail_log notify
acl"
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> passdb {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      args =
/etc/dovecot/dovecot-ldap-users.conf.ext
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      driver =
ldap
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> name =
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> userdb {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      args = uid=vmail gid=mail
home=/var/vmail/%d/%n
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      driver =
static
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> name =
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> protocol lda
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mail_plugins = " sieve
acl"
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> userdb {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      args =
/etc/dovecot/dovecot-ldap-users.conf.ext
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      driver =
ldap
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> name =
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      override_fields = uid=vmail gid=mail
home=/var/vmail/%d/%n
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>  }   userdb {     args =
/etc/dovecot/dovecot-ldap-groups.conf.ext
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      driver = ldap     name =     override_fields =
uid=vmail
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>  gid=mail home=/var/vmail/%d/Public/.%n

<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>
mail=maildir:/var/vmail/%d/Public/.%n
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> protocol lmtp
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mail_plugins = " sieve
acl"
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    postmaster_address =
postmaster@modulus.gr
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> userdb {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      args =
/etc/dovecot/dovecot-ldap-users.conf.ext
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      driver =
ldap
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> name =
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      override_fields = uid=vmail gid=mail
home=/var/vmail/%d/%n
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>  }   userdb {     args =
/etc/dovecot/dovecot-ldap-groups.conf.ext
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      driver = ldap     name =     override_fields =
uid=vmail
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>  gid=mail home=/var/vmail/%d/Public/.%n

<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>
mail=maildir:/var/vmail/%d/Public/.%n
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> protocol doveadm
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> userdb {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      args =
/etc/dovecot/dovecot-ldap-users.conf.ext
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      driver =
ldap
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> name =
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      override_fields = uid=vmail gid=mail
home=/var/vmail/%d/%n
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>  }   userdb {     args =
/etc/dovecot/dovecot-ldap-groups.conf.ext
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      driver = ldap     name =     override_fields =
uid=vmail
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>  gid=mail home=/var/vmail/%d/Public/.%n

<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>
mail=maildir:/var/vmail/%d/Public/.%n
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> protocol sieve
{
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    mail_max_userip_connections =
10
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    managesieve_implementation_string = Dovecot
Pigeonhole
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    managesieve_logout_format =
bytes=%i/%o
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>    managesieve_max_line_length =
65536
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> passdb {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      args =
/etc/dovecot/dovecot-ldap-users.conf.ext
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      driver =
ldap
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> name =
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> userdb {
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      args = uid=vmail gid=mail
home=/var/vmail/%d/%n
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">>      driver =
static
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> name =
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
color="#7f0000" size="2"><span style="
font-size:10pt">> }
<font face="Arial"
size="2">