1

Topic: dovecot Maildir folder names UTF-8

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.7.2 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? iRedMail Easy
- Linux/BSD distribution name and version: 5.14.0-503.26.1.el9_5.x86_64 GNU/Linux
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Mar 19 11:54:42 mail dovecot[864608]: imap(info@infinity.ru)<1236235><aLRlKq4wPKd/AAAB>: Error: rename(/home/vmail/vmail1/infinity.ru/info//Maildir/.INBOX.0)&BB4EQgRHBDUEQgRL- &BCQEOAQ1BEEEQgQw-.1) &BCQEOAQ1BEEEQgQw- &BDoENQRABDAEPAQ4BDoEMA-.Booking &BD0EMA- &BEIEMAQ8BD4ENgQ9BDU- (&BC0EOgRBBD8ENQRABEI-).&BC0EQQQ,BDUEQARC- &BBsEPgQzBDgEQQRCBDgEOgQw-(&BCIEOAQ8BEcENQQ9BDoEPg-) .&BBIEPgQ3BDIEQAQwBEI-, /home/vmail/vmail1/infinity.ru/info//Maildir/.INBOX.0)&BB4EQgRHBDUEQgRL- &BCQEOAQ1BEEEQgQw-.1) &BCQEOAQ1BEEEQgQw- &BDoENQRABDAEPAQ4BDoEMA-.Booking &BD0EMA- &BEIEMAQ8BD4ENgQ9BDU- (&BC0EOgRBBD8ENQRABEI-).&BC0EQQQ,BDUEQARC- &BBsEPgQzBDgEQQRCBDgEOgQw-(&BCIEOAQ8BEcENQQ9BDoEPg-) .&BBIEPgQ3BDIEQAQwBEI- &BBgEIgQh-) failed: File name too long


Hello friends! Help if anyone has encountered this. Is it possible to force saving directories in UTF 8 format on disk in the mail directory?
My users really like to make a lot of subfolders.
In the end, I got the error
DOVECOT: failed: File name too long
folder names in cyrillic

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: dovecot Maildir folder names UTF-8

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.7.2 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? iRedMail Easy
- Linux/BSD distribution name and version: 5.14.0-503.26.1.el9_5.x86_64 GNU/Linux
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Mar 19 11:54:42 mail dovecot[864608]: imap(info@infinity.ru)<1236235><aLRlKq4wPKd/AAAB>: Error: rename(/home/vmail/vmail1/infinity.ru/info//Maildir/.INBOX.0)&BB4EQgRHBDUEQgRL- &BCQEOAQ1BEEEQgQw-.1) &BCQEOAQ1BEEEQgQw- &BDoENQRABDAEPAQ4BDoEMA-.Booking &BD0EMA- &BEIEMAQ8BD4ENgQ9BDU- (&BC0EOgRBBD8ENQRABEI-).&BC0EQQQ,BDUEQARC- &BBsEPgQzBDgEQQRCBDgEOgQw-(&BCIEOAQ8BEcENQQ9BDoEPg-) .&BBIEPgQ3BDIEQAQwBEI-, /home/vmail/vmail1/infinity.ru/info//Maildir/.INBOX.0)&BB4EQgRHBDUEQgRL- &BCQEOAQ1BEEEQgQw-.1) &BCQEOAQ1BEEEQgQw- &BDoENQRABDAEPAQ4BDoEMA-.Booking &BD0EMA- &BEIEMAQ8BD4ENgQ9BDU- (&BC0EOgRBBD8ENQRABEI-).&BC0EQQQ,BDUEQARC- &BBsEPgQzBDgEQQRCBDgEOgQw-(&BCIEOAQ8BEcENQQ9BDoEPg-) .&BBIEPgQ3BDIEQAQwBEI- &BBgEIgQh-) failed: File name too long


Hello friends! Help if anyone has encountered this. Is it possible to force saving directories in UTF 8 format on disk in the mail directory?
My users really like to make a lot of subfolders.
In the end, I got the error
DOVECOT: failed: File name too long
folder names in cyrillic

It looks like the issue is caused by long folder names in Cyrillic, which are encoded using modified UTF-7 by default in Dovecot's Maildir. Since some characters require multiple bytes, long folder names can quickly exceed filesystem limits.
Possible solutions:

    Enable utf8=yes in Dovecot
    Dovecot supports UTF-8 storage for Maildir folder names starting from version 2.3. However, it's disabled by default. You can enable it in your configuration:

doveadm mailbox mutf7 -u info@infinity.ru list

If this command shows modified UTF-7 folder names, you may want to enable UTF-8 folder names in Dovecot.

Edit /etc/dovecot/conf.d/10-mail.conf and add:

maildir_utf8=yes

Restart Dovecot:

    systemctl restart dovecot

    Check Filesystem Limitations
    Some filesystems (like ext4) have filename length limits (typically 255 bytes). If your users create deeply nested folders with long Cyrillic names, you may hit this limit. Consider using shorter folder names or restructuring the mailbox hierarchy.

    Convert Folder Names
    If you already have a lot of existing folders in modified UTF-7, you might need to rename them after enabling maildir_utf8=yes. Use the doveadm rename command or manually rename them.

    Consider a Different Mailbox Format
    If you frequently run into filename length issues, you might consider switching from Maildir to an alternative format like mdbox, which avoids long directory names.

Hope this helps! Let me know if you need more details.

3 (edited by dikey422 2025-03-20 13:43:25)

Re: dovecot Maildir folder names UTF-8

Edit /etc/dovecot/conf.d/10-mail.conf and add:

maildir_utf8=yes

Restart Dovecot:

    systemctl restart dovecot

Thank you!
Enabling this option worked. Dovecot understands Cyrillic names.
How to configure it to automatically create folders in UTF-8.
Conducted a test. When creating new subfolders, UTF-7 is also used.
I would not like to constantly monitor users and rename folders.

Post's attachments

Screenshot_19.jpg
Screenshot_19.jpg 89.52 kb, 1 downloads since 2025-03-20 

You don't have the permssions to download the attachments of this post.

4

Re: dovecot Maildir folder names UTF-8

Try this: in /etc/dovecot/dovecot.conf, append ":UTF-8=" in existing `mail_location =` setting like below:

# OLD
#mail_location = maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/

# NEW
mail_location = maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/:UTF-8=

Restarting Dovecot is required.

5

Re: dovecot Maildir folder names UTF-8

ZhangHuangbin wrote:

Try this: in /etc/dovecot/dovecot.conf, append ":UTF-8=" in existing `mail_location =` setting like below:

# OLD
#mail_location = maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/

# NEW
mail_location = maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/:UTF-8=

Restarting Dovecot is required.

I tried to set this parameter, it doesn't work. Folders are still created in UTF-7

6

Re: dovecot Maildir folder names UTF-8

FYI https://doc.dovecot.org/2.3/configurati … _location/