1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-09-21 05:47:29 +02:00

imapnotify: enable STARTTLS if enabled in email account config (#5013)

* imapnotify: enable STARTTLS if enabled in email account config

Since version 2.3.10 goimapnotify supports starttls. In version 2.3.11 a
typo in the settings was fixed, using tlsOptions.starttls to enable it.

This commit enables starttls in the goimapnotify config file if it is
enabled in the email account's imap settings.

* imapnotify: test generated config file

Compare the generated service config file with a manually verified
sample.
This commit is contained in:
Rafael Carvalho 2024-02-10 22:01:01 +00:00 committed by Mikilio
parent 3d10daecd3
commit 5ff30300d7
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F
3 changed files with 7 additions and 0 deletions

View file

@ -72,6 +72,7 @@ let
inherit (account.imap) host;
inherit port;
tls = account.imap.tls.enable;
tlsOptions.starttls = account.imap.tls.useStartTls;
username = account.userName;
passwordCmd =
lib.concatMapStringsSep " " lib.escapeShellArg account.passwordCommand;

View file

@ -0,0 +1 @@
{"boxes":["Inbox"],"host":"imap.example.com","onNewMail":"@notmuch@/bin/notmuch new\n","passwordCmd":"'password-command'","port":993,"tls":true,"tlsOptions":{"starttls":false},"username":"home.manager"}

View file

@ -35,5 +35,10 @@ with lib;
serviceFileNormalized="$(normalizeStorePaths "$serviceFile")"
assertFileExists $serviceFile
assertFileContent $serviceFileNormalized ${./imapnotify.service}
configFile="home-files/.config/imapnotify/imapnotify-hm-example.com-config.json"
configFileNormalized="$(normalizeStorePaths "$configFile")"
assertFileExists $configFile
assertFileContent $configFileNormalized ${./imapnotify-config.json}
'';
}