dovecot: add support store mailbox names on disk using UTF-8

This commit is contained in:
Lafiel 2023-03-12 20:13:51 +03:00
parent 84783b661e
commit 008d78cc21
No known key found for this signature in database
GPG key ID: 73D88ADA542EB43B
2 changed files with 10 additions and 1 deletions

View file

@ -574,6 +574,14 @@ in
'';
};
useUTF8FolderNames = mkOption {
type = types.bool;
default = false;
description = ''
Store mailbox names on disk using UTF-8 instead of modified UTF-7 (mUTF-7).
'';
};
hierarchySeparator = mkOption {
type = types.str;
default = ".";

View file

@ -29,10 +29,11 @@ let
bool2int = x: if x then "1" else "0";
maildirLayoutAppendix = lib.optionalString cfg.useFsLayout ":LAYOUT=fs";
maildirUTF8FolderNames = lib.optionalString cfg.useUTF8FolderNames ":UTF-8";
# maildir in format "/${domain}/${user}"
dovecotMaildir =
"maildir:${cfg.mailDirectory}/%d/%n${maildirLayoutAppendix}"
"maildir:${cfg.mailDirectory}/%d/%n${maildirLayoutAppendix}${maildirUTF8FolderNames}"
+ (lib.optionalString (cfg.indexDir != null)
":INDEX=${cfg.indexDir}/%d/%n"
);