Adding virtual folders to an existing dovecot installation

Christian Wolf account+dovecot at christian-wolf.click
Thu May 6 16:11:41 EEST 2021


Hello dear dovecot mailinglist,

I am having a dovecot installation that is working so far (together with sieve 
and managesieve).

Now, I found the possibility to add a virtual folder to the server promising. 
I sort various mails using a per-user sieve script into subfolders. This works 
well on the latop but the mobile device does not like too many folders to 
check. So, I wanted to create a virtual inbox that holds all unread messages. 
I found this documentation:
https://doc.dovecot.org/configuration_manual/virtual_plugin/

Now, I have first one question: When I use the virtual folder and read a 
message/mark it as read, will this be reflected on the underlaying folder or 
will it cause trouble on dovecot?

As far as I understand, usage of sieve filtering and the virtual plugin is 
considered critical as mentioned in the documentation. This is due to the 
fact, that the virtual mailboxes are read-only by default (unless a folder is 
prefixed with a !-symbol). Sieve will try to filter the virtual folder as well 
be default and moving a message to another folder will fail the read-only 
assumption.

Honestly, I do not get the content of https://doc.dovecot.org/
configuration_manual/virtual_plugin/#sieve-filters-with-virtual-mailboxes by 
100%. The first paragraph indicates that sieve plus virtual mailboxes are a 
complete no-go, while the second indicates that a safe configuration is needed. 
Could someone please elaborate this a bit more?

I have not yet changed anything as I did not want blindly break my production 
mail system. The current (unaltered) configuration I will attach below.

Bonus question: Is it possible to restrict the effect of the virtual plugin to 
certain (virtual) user accounts?

Thank you very much
Christian

# dovecot --version
2.3.13 (89f716dc2)

#dovecot -n
# 2.3.13 (89f716dc2): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.13 (cdd19fe3)
# OS: Linux 5.11.2-arch1-1 x86_64  
# Hostname: server-hh.hh.lupus
auth_mechanisms = plain login
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 index ihave duplicate 
mime foreverypart extracttext

namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Templates {
    auto = subscribe
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  prefix = 
}

passdb {
  args = scheme=PLAIN username_format=%n /home/.vmail/%d/etc/shadow
  driver = passwd-file
}
plugin {
  sieve = file:~/sieve;active=~/.dovecot.sieve
  stats_refresh = 30 secs
  stats_track_cmds = yes
}
protocols = imap lmtp sieve
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}
service stats {
  fifo_listener stats-mail {
    mode = 0600
    user = vmail
  }
}
ssl = required
ssl_cert = </etc/letsencrypt/live/dovecot/fullchain.pem
ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-
SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-
AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-
SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-
SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-
SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-
AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-
SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-
SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!
MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
ssl_prefer_server_ciphers = yes
userdb {
  args = uid=vmail gid=vmail home=/home/.vmail/%d/mails/%n
  driver = static
}
protocol lmtp {
  mail_plugins = " sieve"
  postmaster_address = postmaster at example.com
}
protocol lda {
  mail_plugins = " sieve"
}
protocol imap {
  mail_plugins = " old_stats"
}





More information about the dovecot mailing list