dovecot: add options to selectively enable/disable the IMAP and/or POP3 listener
This commit is contained in:
parent
1b47614c46
commit
4b78161e3e
@ -10,7 +10,7 @@ let
|
||||
''
|
||||
base_dir = /var/run/dovecot2/
|
||||
|
||||
protocols = imap pop3
|
||||
protocols = ${optionalString cfg.enableImap "imap"} ${optionalString cfg.enablePop3 "pop3"}
|
||||
''
|
||||
+ (if cfg.sslServerCert!="" then
|
||||
''
|
||||
@ -62,6 +62,16 @@ in
|
||||
description = "Whether to enable the Dovecot 2.x POP3/IMAP server.";
|
||||
};
|
||||
|
||||
enablePop3 = mkOption {
|
||||
default = true;
|
||||
description = "Start the POP3 listener (when Dovecot is enabled).";
|
||||
};
|
||||
|
||||
enableImap = mkOption {
|
||||
default = true;
|
||||
description = "Start the IMAP listener (when Dovecot is enabled).";
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
default = "dovecot2";
|
||||
description = "Dovecot user name.";
|
||||
@ -146,6 +156,9 @@ in
|
||||
|
||||
environment.systemPackages = [ pkgs.dovecot ];
|
||||
|
||||
assertions = [{ assertion = cfg.enablePop3 || cfg.enableImap;
|
||||
message = "dovecot needs at least one of the IMAP or POP3 listeners enabled";}];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user