dovecot: add options to selectively enable/disable the IMAP and/or POP3 listener

This commit is contained in:
Peter Simons 2012-09-30 00:53:50 +02:00
parent 1b47614c46
commit 4b78161e3e

View File

@ -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";}];
};
}