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 { extraEmailProvider = 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 {
type = types.lines; type = types.lines;
default = ""; default = "";
description = '' description = ''

View file

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

View file

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