[Dovecot] Bug report: "doveadm rename" encodes special characters wrongly in mUTF-7 (in fs)
Hello there,
I'm pretty sure I found a bug in latest Dovecot 2.2.5.5 (EE) when playing with the doveadm command.
Naturally renaming a users mail folder should be done via "doveadm es consistent.
So when using "doveadm rename" trying to rename a folder with special characters e.g. german umlauts like "ä" it seems to create the folder wrongly in the filesystem.
Example: When I want to rename a users folder 'geschaftliches' to 'gesch&AOQ-ftliches' ("&AOQ-" is the correct mUTF-7 encoding for "ä") using the command
doveadm mailbox rename -u user 'geschaftliches' 'gesch&AOQ-ftliches'
it ends up in the filesystem renamed as "gesch&-AOQ-ftliches" which has an falsely added "-" set after the "&" and therefore the folder is also wrongly shown in Mailclients like Thunderbird or web-mail systems like Horde. (Apparently "doveadm rename" supports only UTF-8 which shows up when trying to rename the folder with "doveadm mailbox rename -u user 'geschäftliches'" I get the error message "Fatal: Mailbox name not valid UTF-8: geschäftliches")
To get things worse, when renaming the mailfolder in Thunderbird to "geschäftliches" it gets correctly written in the filesystem as "gesch&AOQ-ftliches" - but afterwards it's NOT found anymore in the dovecot index, e.g. when trying doveadm force-resync -u user it is not listed anymore (until back-renaming in fs to the name it was indexed before).
This problem can be reproduced. Can you please fix this? (Not sure if this might change - maybe add an option to support UTF-7 similar to doveadm mailbox list "-7" option)
Thanks in advance, Megodin
My (relevant part) dovecot configuration (dovecot -n):
mailstorage @ NFS with nfsvers=3 (NetApp)
# 2.2.5.5 (e5350245ad9b): /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-279.22.1.el6.x86_64 x86_64 CentOS release 6.4 (Final) nfs auth_cache_size = 10 M auth_cache_ttl = 10 mins auth_debug = yes auth_master_user_separator = * auth_username_format = %n auth_verbose = yes disable_plaintext_auth = no listen = * lock_method = dotlock mail_debug = yes mail_fsync = always mail_gid = vmail mail_home = /mnt/placeholder/%u mail_location = sdbox:/mnt/placeholder/%u/mailstore mail_plugins = " quota fts fts_lucene" mail_privileged_group = mail mail_uid = 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 ihave mmap_disable = yes passdb { args = /etc/dovecot/users.blocked deny = yes driver = passwd-file } passdb { args = /etc/dovecot/passwd.masterusers driver = passwd-file master = yes } passdb { args = /etc/dovecot/dovecot-ldap.conf.ext driver = ldap } plugin { fts = lucene fts_lucene = whitespace_chars=@. quota = dict:User quota::file:%h/dovecot-quota quota_rule = *:storage=100M quota_rule2 = Trash:storage=+50M quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=98%% quota-warning 98 %u sieve = /mnt/placeholder/%u/.dovecot.sieve sieve_dir = /mnt/placeholder/%u/sieve sieve_global_dir = /var/lib/dovecot/sieve/global/ sieve_global_path = /var/lib/dovecot/sieve/default.sieve } postmaster_address = postmaster@example.com protocols = imap pop3 sieve service auth { unix_listener auth-userdb { group = vmail user = vmail } } service managesieve-login { inet_listener sieve { port = 4190 } } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = vmail } user = vmail } ssl_cert =
Alle Postfächer an einem Ort. Jetzt wechseln und E-Mail-Adresse mitnehmen! http://email.freenet.de/basic/Informationen
Send and receive anonymous emails to your inbox with InboxAlias. http://www.inboxalias.com
On 20.9.2013, at 17.42, megodin@inboxalias.com wrote:
So when using "doveadm rename" trying to rename a folder with special characters e.g. german umlauts like "ä" it seems to create the folder wrongly in the filesystem.
Example: When I want to rename a users folder 'geschaftliches' to 'gesch&AOQ-ftliches' ("&AOQ-" is the correct mUTF-7 encoding for "ä") using the command
Forget about mUTF-7 with Dovecot. It's an IMAP-protocol relic, and Dovecot is trying to get rid of it in as many places as possible. Although by default the filesystem users mUTF-7, but that can also be changed with a setting.
(Apparently "doveadm rename" supports only UTF-8 which shows up when trying to rename the folder with "doveadm mailbox rename -u user 'geschäftliches'" I get the error message "Fatal: Mailbox name not valid UTF-8: geschäftliches")
I suspect your shell is breaking the 8bit chars into invalid UTF-8. I just tried and it works fine with me.
To get things worse, when renaming the mailfolder in Thunderbird to "geschäftliches" it gets correctly written in the filesystem as "gesch&AOQ-ftliches" - but afterwards it's NOT found anymore in the dovecot index, e.g. when trying doveadm force-resync -u user it is not listed anymore (until back-renaming in fs to the name it was indexed before).
Folders aren't indexed by default (mailbox_list_index=no) and force-resync doesn't affect them. Are you saying "doveadm mailbox list -u user" doesn't show some folder? I'm not aware of any bugs related to this.
This problem can be reproduced. Can you please fix this?
I'd need to get some more specifics. Show show exists in filesystems and what commands don't produce expected results (and what they produce instead).
(Not sure if this might change - maybe add an option to support UTF-7 similar to doveadm mailbox list "-7" option)
Nah, mUTF-7 hopefully will die some day.
participants (2)
-
megodin@inboxalias.com
-
Timo Sirainen