address review comments

This commit is contained in:
James ‘Twey’ Kay 2023-02-27 14:52:16 +00:00
parent 14cc97446d
commit 1861e82add
Failed to generate hash of commit
3 changed files with 4 additions and 18 deletions

View file

@ -75,16 +75,7 @@ in
'';
};
template = mkOption {
type = types.nullOr types.lines;
default = null;
description = ''
The text of a template for the autoconfig XML file.
If provided, overrides `templateFile`.
'';
};
extraProviderConfig = mkOption {
extraEmailProvider = mkOption {
type = types.lines;
default = "";
description = ''

View file

@ -23,6 +23,6 @@
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</outgoingServer>
@extraProviderConfig@
@extraEmailProvider@
</emailProvider>
</clientConfig>

View file

@ -30,16 +30,11 @@ in {
mailserver.autoconfig.webRoot = pkgs.substituteAll ({
name = "config-v1.1.xml";
dir = "mail";
src = if cfg.template == null
then cfg.templateFile
else pkgs.writeTextFile {
name = "mailserver-autoconfig-template.xml";
text = cfg.template;
};
src = cfg.templateFile;
} // {
hostname = ms.fqdn;
inherit (cfg)
emailProviderId displayName displayShortName extraProviderConfig;
emailProviderId displayName displayShortName extraEmailProvider;
imapSslServer = incomingServer ms.enableImapSsl 993 "SSL";
imapServer = incomingServer ms.enableImapSsl 143 "STARTTLS";
pop3SslServer = incomingServer ms.enablePop3Ssl 995 "SSL";