discovery-scope

This commit is contained in:
2026-04-14 15:24:12 +02:00
parent 3630b9583b
commit fc6a5e6c29
2 changed files with 18 additions and 7 deletions
@@ -5,6 +5,8 @@
... ...
}: }:
let let
radicaleHostFor = domain: "cal.${domain}";
mkThunderbirdAutoconfig = domain: mkThunderbirdAutoconfig = domain:
pkgs.writeText "autoconfig-${domain}.xml" '' pkgs.writeText "autoconfig-${domain}.xml" ''
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
@@ -29,6 +31,18 @@ let
<username>%EMAILADDRESS%</username> <username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication> <authentication>password-cleartext</authentication>
</outgoingServer> </outgoingServer>
<addressBook type="carddav">
<username>%EMAILADDRESS%</username>
<authentication>http-basic</authentication>
<serverURL>https://${radicaleHostFor domain}/</serverURL>
</addressBook>
<calendar type="caldav">
<username>%EMAILADDRESS%</username>
<authentication>http-basic</authentication>
<serverURL>https://${radicaleHostFor domain}/</serverURL>
</calendar>
</emailProvider> </emailProvider>
</clientConfig> </clientConfig>
''; '';
+2 -5
View File
@@ -13,13 +13,10 @@ lib.mkIf hasMailDiscoveryConfig (
domain = builtins.head cfg.domains; domain = builtins.head cfg.domains;
radicaleHost = "cal.${domain}"; radicaleHost = "cal.${domain}";
mailAccounts = cfg.loginAccounts; mailAccounts = cfg.loginAccounts;
discoveryHosts = lib.unique ( discoveryHosts = lib.unique [
cfg.domains
++ [
cfg.fqdn cfg.fqdn
radicaleHost radicaleHost
] ];
);
accountHash = accountHash =
mail: account: mail: account: