#ssl_verify_client_cert = yes
listen = *
- # If needed, may be overrided by userdb_mail
mail_home = ${stateDir}/home/%d/%n
# Read multiple mails in parallel, improves performance
mail_prefetch_count = 20
#pass_filter = (&(objectClass=posixAccount)(uid=%n)(mailEnabled=TRUE))
#pass_attrs = uidNumber=userdb_uid,\
# gidNumber=userdb_gid,\
+# mailHomeDirectory=userdb_home,\
# mailStorageDirectory=userdb_mail,\
-# =userdb_mail_access_groups=sourcephile,\
+# mailGroupMember=userdb_mail_access_groups,\
# quotaBytes=userdb_quota_rule=*:bytes=%{ldap:quotaBytes},\
# =user=%n@%d
-# #homeDirectory=userdb_home
#default_pass_scheme = SSHA
# dovecot userdb query
# For dovecot-lda
user_filter = (&(objectClass=posixAccount)(uid=%n)(mailEnabled=TRUE))
-user_attrs = mailStorageDirectory=mail,\
- uidNumber=uid,\
+user_attrs = uidNumber=uid,\
gidNumber=gid,\
+ mailHomeDirectory=home,\
mailStorageDirectory=mail,\
mailGroupMember=mail_access_groups,\
quotaBytes=quota_rule=*:bytes=%{ldap:quotaBytes}
require [ "date", "fileinto", "mailbox", "variables" ];
-if currentdate :matches "year" "*" { set "year" "${1}"; }
+#if currentdate :matches "year" "*" { set "year" "${1}"; }
#if currentdate :matches "month" "*" { set "month" "${1}"; }
-if exists "List-ID" {
- if header :matches "List-ID" "*<*.*.*.*>*" {
+if exists "X-MC-User" {
+ if header :matches "From" "*<*@*.*>*" {
+ set "list" "${2}";
+ set "domain" "${3}";
+ }
+ fileinto :create "Listes+${domain}+${list}";
+ stop;
+}
+elsif exists "List-Id" {
+ if header :matches "List-Id" "*<*.*.*.*>*" {
set "list" "${2}";
set "domain" "${4}";
}
- elsif header :matches "List-ID" "*<*.*.*>*" {
+ elsif header :matches "List-Id" "*<*.*.*>*" {
set "list" "${2}";
set "domain" "${3}";
}
- fileinto :create "Listes+${domain}+${list}+${year}";
+ fileinto :create "Listes+${domain}+${list}";
stop;
}
gidNumber = groups.julm.gid;
mailAlias = [ "julien.moutinho" ];
userPassword = pass-chomp "members/julm/mail/hashedPassword";
+ mailHomeDirectory = "/home/${uid}/mail/${domain}";
mailStorageDirectory =
- let stateDir = "/var/lib/dovecot";
- d=domain;
- in
+ let stateDir = "/var/lib/dovecot"; in
# I'm personnaly using "maildir:" instead of "sdbox:" to be able to use a local (neo)mutt on it,
# bypassing IMAP because (neo)mutt support of IMAP is very bad
# (can't even have a decent $folder_format (with %n or %m) working,
# WARNING: regarding the atomicity of backuping,
# it's not a good idea to put the mails
# and the index/control on different ZFS datasets like here.
- "maildir:/home/${uid}/mail/${d}/mail:LAYOUT=maildir++:UTF-8:CONTROL=${stateDir}/control/${d}/${uid}:INDEX=${stateDir}/index/${d}/${uid}";
+ "maildir:/home/${uid}/mail/${domain}/mail:LAYOUT=maildir++:UTF-8:CONTROL=${stateDir}/control/${domain}/${uid}:INDEX=${stateDir}/index/${domain}/${uid}";
}
];
};
, userPassword ? null # Use slappasswd -o module-load=pw-pbkdf2 -h "{PBKDF2-SHA256}"
, mailAlias ? []
, homeDirectory ? ""
+, mailHomeDirectory ? null
, mailStorageDirectory ? null
, loginShell ? "/run/current-system/sw/bin/bash"
, mailEnabled ? true
++ [ "homeDirectory: ${homeDirectory}" ]
++ lib.optional (loginShell != null) "loginShell: ${loginShell}"
++ lib.optional (userPassword != null) "userPassword: ${userPassword}"
+ ++ lib.optional (mailHomeDirectory != null) "mailHomeDirectory: ${mailHomeDirectory}"
++ lib.optional (mailStorageDirectory != null) "mailStorageDirectory: ${mailStorageDirectory}"
++ map (forward: "mailForwardingAddress: ${forward}") mailForwardingAddress
++ map (alias: "mailAlias: ${alias}@${domain}") mailAlias
gidNumber = groups.julm.gid;
mailAlias = [ "julien.moutinho" ];
userPassword = pass-chomp "members/julm/mail/hashedPassword";
+ mailHomeDirectory = "/home/${uid}/mail/${domain}";
mailStorageDirectory =
- let stateDir = "/var/lib/dovecot";
- d=domain;
- in
+ let stateDir = "/var/lib/dovecot"; in
# I'm personnaly using "maildir:" instead of "sdbox:" to be able to use a local (neo)mutt on it,
# bypassing IMAP because (neo)mutt support of IMAP is very bad
# (can't even have a decent $folder_format (with %n or %m) working,
# WARNING: regarding the atomicity of backuping,
# it's not a good idea to put the mails
# and the index/control on different ZFS datasets like here.
- "maildir:/home/${uid}/mail/${d}/mail:LAYOUT=maildir++:UTF-8:CONTROL=${stateDir}/control/${d}/${uid}:INDEX=${stateDir}/index/${d}/${uid}";
+ "maildir:/home/${uid}/mail/${domain}/mail:LAYOUT=maildir++:UTF-8:CONTROL=${stateDir}/control/${domain}/${uid}:INDEX=${stateDir}/index/${domain}/${uid}";
}
];
};