Discussion:
Trouble getting listescape plugin to work with "$" separator (as demonstrated in Wiki) in Dovecot 2.2.9
Ben Johnson
2014-10-01 18:43:57 UTC
Permalink
Hello,

I'm attempting to install the listescape plugin so that IMAP users are
able to include periods (.) and forward slashes (/) in IMAP directory names.

I'm following the instructions at
http://wiki2.dovecot.org/Plugins/Listescape , which imply that this can
be accomplished by enabling the listescape plugin and using the dollar
sign ($) as the separator.

With regard to my dovecot configuration, first, I changed

protocol imap {
mail_plugins = quota imap_quota antispam
}

to

protocol imap {
mail_plugins = quota imap_quota antispam listescape

namespace private {
separator = $
inbox = yes
}
}

When I start dovecot, I receive the following error:


doveconf: Warning: NOTE: You can get a new clean config file with:
doveconf -n > dovecot-new.conf
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:102:
namespace private {} has been replaced by namespace { type=private }


Pretty straightforward; I made the required change to yield

protocol imap {
mail_plugins = quota imap_quota antispam listescape

namespace {
type = private
separator = $
inbox = yes
}
}

But now, when I attempt to start dovecot, I receive the following error:


doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf
line 104: Unknown variable: $
doveconf: Error: managesieve-login: dump-capability process returned 89
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf
line 104: Unknown variable: $


Is it possible that the instructions at the Wiki 2 URL cited above are
out-of-date?

If I try to escape the $ with any other character (I'm just shooting in
the dark regarding possible escape characters, as I cannot find
definitive documentation that pertains to escaping $ in the dovecot
configuration), I receive yet another error:


doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf:
Namespace '': Hierarchy separator must be only one character long
doveconf: Error: managesieve-login: dump-capability process returned 89
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf:
Namespace '': Hierarchy separator must be only one character long


Ultimately, I have two questions:

1.) Is the nesting structure that I've employed correct? The Wiki 2 page
is not clear with regard to the nesting; is it correct to put the
"namespace" block inside the "protocol imap" block, as I demonstrated above?

2.) Is it possible to escape the dollar sign so that it can be used as
the separator?

Full "doveconf -n" output is included below.

Thanks for any assistance,

-Ben



# doveconf -n
# 2.2.9: /etc/dovecot/dovecot.conf
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf
line 104: Unknown variable: $
doveconf: Error: managesieve-login: dump-capability process returned 89
# OS: Linux 3.13.0-34-generic x86_64 Ubuntu 14.04.1 LTS
auth_mechanisms = plain login
disable_plaintext_auth = no
listen = *,[::]
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_debug = yes
mail_privileged_group = vmail
passdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
}
plugin {
antispam_backend = pipe
antispam_debug_target = syslog
antispam_pipe_program = /bin/bash
antispam_pipe_program_args = /usr/local/bin/sa-learn-pipe.sh
antispam_pipe_program_notspam_arg = --ham
antispam_pipe_program_spam_arg = --spam
antispam_pipe_tmpdir = /tmp
antispam_spam_pattern_ignorecase = SPAM;JUNK
antispam_trash_pattern_ignorecase = trash;Deleted *
antispam_verbose_debug = 1
quota = dict:user::file:/var/vmail/%d/%n/.quotausage
quota_rule2 = Trash:storage=+100M
quota_rule3 = Junk:ignore
quota_rule4 = INBOX:storage=+100M
quota_warning = storage=100%% quota-reached 100 %u %d
quota_warning2 = storage=95%% quota-warning 95 %u %d
quota_warning3 = storage=80%% quota-warning 80 %u %d
quota_warning4 = -storage=100%% quota-below below %u %d
sieve = /var/vmail/%d/%n/.sieve
}
postmaster_address = postmaster at localhost.com
protocols = imap pop3 sieve
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-userdb {
group = vmail
mode = 0600
user = vmail
}
user = root
}
service config {
unix_listener config {
group = vmail
mode = 0600
user = vmail
}
}
service imap-login {
client_limit = 1000
process_limit = 500
}
service quota-below {
executable = script /usr/local/bin/quota-below.sh
unix_listener quota-below {
group = vmail
mode = 0666
user = vmail
}
user = vmail
}
service quota-reached {
executable = script /usr/local/bin/quota-reached.sh
unix_listener quota-reached {
group = vmail
mode = 0666
user = vmail
}
user = vmail
}
service quota-warning {
executable = script /usr/local/bin/quota-warning.sh
unix_listener quota-warning {
group = vmail
mode = 0666
user = vmail
}
user = vmail
}
ssl_cert = </etc/postfix/smtpd.cert
ssl_key = </etc/postfix/smtpd.key
userdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
}
protocol imap {
mail_plugins = quota imap_quota antispam listescape
namespace {
inbox = yes
location =
prefix =
separator = $
type = private
}
}
protocol pop3 {
mail_plugins = quota
pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
info_log_path =
log_path =
mail_plugins = sieve quota
}
Teemu Huovila
2014-10-02 13:57:57 UTC
Permalink
Post by Ben Johnson
1.) Is the nesting structure that I've employed correct? The Wiki 2 page
is not clear with regard to the nesting; is it correct to put the
"namespace" block inside the "protocol imap" block, as I demonstrated above?
I think it would be better, if you put the namespace configuration at the top level. See
http://master.wiki2.dovecot.org/Namespaces or 10-mail.conf and 15-mailboxes.conf, that are located in the
doc/example-config/conf.d/ directory of the Dovecot sources, for more examples.
Post by Ben Johnson
2.) Is it possible to escape the dollar sign so that it can be used as
the separator?
There was a mistake in the wiki. You should quote the $ like this: "$".

br,
Teemu Huovila
Ben Johnson
2014-10-02 14:23:16 UTC
Permalink
Post by Teemu Huovila
Post by Ben Johnson
1.) Is the nesting structure that I've employed correct? The Wiki 2 page
is not clear with regard to the nesting; is it correct to put the
"namespace" block inside the "protocol imap" block, as I demonstrated above?
I think it would be better, if you put the namespace configuration at the top level. See
http://master.wiki2.dovecot.org/Namespaces or 10-mail.conf and 15-mailboxes.conf, that are located in the
doc/example-config/conf.d/ directory of the Dovecot sources, for more examples.
Post by Ben Johnson
2.) Is it possible to escape the dollar sign so that it can be used as
the separator?
There was a mistake in the wiki. You should quote the $ like this: "$".
br,
Teemu Huovila
Teemu,

Thank you!!! Quoting the "$" fixed the syntax issue. And I moved the
namespace to the root level of the configuration, per your advice.

Now, the only problem I see is that when I attempt to create a new
folder beneath the Inbox (whether it contains a "." or not), the folder
appears at the root-level of the IMAP account, at the same level as the
Inbox itself. The folder name is "INBOX.My Folder".

Also, if I try to select the folder and view its contents, I receive the
error, "Mailbox doesn't exist: INBOX.My Folder". But this may simply be
a product of a misconfiguration on my part.

For what it's worth, this seems to happen regardless of the separator
that I define in the namespace.

Do I need to change something else in the Dovecot config for this to
work the way that I'm intending?

Thanks again for your invaluable assistance,

-Ben
Teemu Huovila
2014-10-03 07:37:27 UTC
Permalink
Post by Ben Johnson
Now, the only problem I see is that when I attempt to create a new
folder beneath the Inbox (whether it contains a "." or not), the folder
appears at the root-level of the IMAP account, at the same level as the
Inbox itself. The folder name is "INBOX.My Folder".
Also, if I try to select the folder and view its contents, I receive the
error, "Mailbox doesn't exist: INBOX.My Folder". But this may simply be
a product of a misconfiguration on my part.
Namespace configuration can be a bit difficult. I urge you to read the wiki page on namespaces carefully and test which
configuration works with your mail clients. It might be as easy, as renaming the namespace you have now to inbox, eg:
namespace INBOX {
inbox = yes
location =
prefix =
separator = $
type = private
}

If that is not what you meant, or does not work for your clients, try with several namespaces and setting the "prefix" in them.

br,
Teemu Huovila

Loading...