Dovecot: allow dot for IMAP folder

Usually the dot is the separator for subfolders – here is the guide how to change it. Tested with Dovecot 2.2.33 with Sieve on Ubuntu 18.04.

Enable Dovecot Listescape plugin

for IMAP, LDA and LMTP and setup hierarchy separator

vi /etc/dovecot/dovecot.conf
protocol imap {
  mail_plugins = quota imap_quota listescape
  namespace {
    type = private
    separator = /
    inbox = yes
  }
}
protocol lda {
postmaster_address = [email protected]
  mail_plugins = sieve quota listescape
  namespace {
    type = private
    separator = /
    inbox = yes
  }
}
protocol lmtp {
postmaster_address = [email protected]
  mail_plugins = quota sieve listescape
  namespace {
    type = private
    separator = /
    inbox = yes
  }
}

#mail_plugins = $mail_plugins quota

Restart Dovecot

service dovecot restart

Check configuration

dovecot -n | grep mail_plugins
  mail_plugins = quota imap_quota listescape
  mail_plugins = quota
  mail_plugins = sieve quota listescape
  mail_plugins = quota sieve listescape
 dovecot -n | grep separator
    separator = /
    separator = /
    separator = /

ISPConfig Mailfilter

If ISPConfig does not allow / as separator, edit

vi /usr/local/ispconfig/interface/web/mail/form/mail_user_filter.tform.php

and replace the regex from

'regex' => '/^[\p{Latin}0-9\.\-\_\ \&]{0,100}$/u',

to

'regex' => '/^[\p{Latin}0-9\/.-_\ \&]{0,100}$/u',

Unfortunately, this is need to be done after every ISPConfig update.

See also