Sieve: fileinto a subfolder of inbox

Federico Fanton federico at panizzolo.it
Fri Dec 2 16:13:00 UTC 2022


Hi everyone!

I'm trying to write a sieve script that moves emails to a *subfolder* of 
the inbox.
My script:


require ["envelope", "fileinto", "mailbox"];

if anyof( address "to" "support at domain.cc",
           address "cc" "support at domain.cc",
           envelope "to" "support at domain.cc" ) {
   fileinto :create "INBOX.support";
}


But this creates a new "support" folder BESIDE the inbox, not INSIDE it.
I've tried replacing "INBOX.support" with "INBOX/support" but then I get 
an error: "Name must not have '/' characters"

Is there something else I could try?

Here is the output of dovecot -n:

# 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.4 ()
# OS: Linux 4.19.0-21-amd64 x86_64 Debian 10.0 ext4
auth_mechanisms = plain login
lda_mailbox_autosubscribe = yes
mail_location = maildir:/home/vmail/maildir/%d/%n/Maildir
mail_plugins = " zlib lazy_expunge"
mail_privileged_group = vmail
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 {
   hidden = yes
   list = no
   location = maildir:/home/vmail/maildir/%d/%n/Maildir/expunged
   prefix = .EXPUNGED/
   separator = /
}
namespace inbox {
   inbox = yes
   location =
   mailbox Drafts {
     special_use = \Drafts
   }
   mailbox Junk {
     special_use = \Junk
   }
   mailbox Sent {
     auto = subscribe
     special_use = \Sent
   }
   mailbox "Sent Messages" {
     special_use = \Sent
   }
   mailbox Trash {
     special_use = \Trash
   }
   prefix =
}
passdb {
   driver = pam
}
passdb {
   args = scheme=SHA1 /etc/dovecot/users.conf
   driver = passwd-file
}
plugin {
   lazy_expunge = .EXPUNGED/
   sieve = file:~/sieve;active=~/.dovecot.sieve
   sieve_vacation_default_period = 1d
   sieve_vacation_to_header_ignore_envelope = yes
}
protocols = imap sieve
service auth {
   executable = /usr/lib/dovecot/auth
   unix_listener /var/spool/postfix/private/auth {
     group = postfix
     mode = 0660
     user = postfix
   }
   unix_listener /var/spool/postfix/private/dovecot-auth {
     group = postfix
     mode = 0660
     user = postfix
   }
   unix_listener auth-master {
     group = vmail
     mode = 0600
     user = vmail
   }
}
service doveadm {
   inet_listener {
     port = 24242
   }
}
service imap-login {
   process_limit = 200
}
service stats {
   unix_listener stats-reader {
     group = vmail
     mode = 0660
     user = vmail
   }
   unix_listener stats-writer {
     group = vmail
     mode = 0660
     user = vmail
   }
}
ssl_cipher_list = 
ALL:!LOW:!SSLv2:ALL:!aNULL:!ADH:!eNULL:!EXP:RC4+RSA:+HIGH:+MEDIUM
ssl_client_ca_dir = /etc/ssl/certs
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
userdb {
   driver = passwd
}
userdb {
   args = uid=1001 gid=1001 home=/home/vmail/maildir/%d/%n 
allow_all_users=yes
   driver = static
}
protocol lda {
   mail_plugins = " zlib lazy_expunge sieve"
}
protocol imap {
   imap_client_workarounds = delay-newmail
   mail_max_userip_connections = 20
}
local 192.168.2.0/24 {
   doveadm_allowed_commands = sieve list,sieve get,sieve put,sieve 
activate,sieve deactivate
   doveadm_password = # hidden, use -P to show it
}

Many thanks for your time!


More information about the dovecot mailing list