- mailLocation = "mbox:~/Mail:INBOX=~/Mail/Inbox:INDEX=~/.imap";
- sslServerCert = "/var/lib/acme/mail/fullchain.pem";
- sslServerKey = "/var/lib/acme/mail/key.pem";
- sslCACert = "/var/lib/acme/mail/fullchain.pem";
- extraConfig = builtins.concatStringsSep "\n" [
- ''
- postmaster_address = postmaster@immae.eu
- mail_attribute_dict = file:%h/dovecot-attributes
- imap_idle_notify_interval = 20 mins
- namespace inbox {
- type = private
- separator = /
- inbox = yes
- list = yes
- }
- ''
-
- # Full text search
- ''
- # needs to be bigger than any mailbox size
- default_vsz_limit = 2GB
- mail_plugins = $mail_plugins fts fts_xapian
+
+ users.users.vhost = {
+ group = "vhost";
+ uid = config.ids.uids.vhost;
+ };
+ users.groups.vhost.gid = config.ids.gids.vhost;
+
+ # https://blog.zeninc.net/index.php?post/2018/04/01/Un-annuaire-pour-les-gouverner-tous.......
+ services.dovecot2 = {
+ enable = true;
+ enablePAM = false;
+ enablePop3 = true;
+ enableImap = true;
+ enableLmtp = true;
+ protocols = [ "sieve" ];
+ modules = [
+ pkgs.dovecot_pigeonhole
+ pkgs.dovecot_fts-xapian
+ ];
+ mailUser = "vhost";
+ mailGroup = "vhost";
+ createMailUser = false;
+ mailboxes = [
+ { name = "Trash"; auto = "subscribe"; specialUse = "Trash"; }
+ { name = "Junk"; auto = "subscribe"; specialUse = "Junk"; }
+ { name = "Sent"; auto = "subscribe"; specialUse = "Sent"; }
+ { name = "Drafts"; auto = "subscribe"; specialUse = "Drafts"; }
+ ];
+ mailLocation = "mbox:~/Mail:INBOX=~/Mail/Inbox:INDEX=~/.imap";
+ sslServerCert = "/var/lib/acme/mail/fullchain.pem";
+ sslServerKey = "/var/lib/acme/mail/key.pem";
+ sslCACert = "/var/lib/acme/mail/fullchain.pem";
+ extraConfig = builtins.concatStringsSep "\n" [
+ ''
+ postmaster_address = postmaster@immae.eu
+ mail_attribute_dict = file:%h/dovecot-attributes
+ imap_idle_notify_interval = 20 mins
+ namespace inbox {
+ type = private
+ separator = /
+ inbox = yes
+ list = yes
+ }
+ ''
+
+ # Full text search
+ ''
+ # needs to be bigger than any mailbox size
+ default_vsz_limit = 2GB
+ mail_plugins = $mail_plugins fts fts_xapian
+ plugin {
+ plugin = fts fts_xapian
+ fts = xapian
+ fts_xapian = partial=2 full=20
+ fts_autoindex = yes
+ fts_autoindex_exclude = \Junk
+ fts_autoindex_exclude2 = \Trash
+ fts_autoindex_exclude3 = Virtual/*
+ }
+ ''
+
+ # Antispam
+ # https://docs.iredmail.org/dovecot.imapsieve.html
+ ''
+ # imap_sieve plugin added below
+