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:
parent
4c0357ff87
commit
fb0196ad9d
|
@ -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;
|
||||
|
|
1
tests/modules/services/imapnotify/imapnotify-config.json
Normal file
1
tests/modules/services/imapnotify/imapnotify-config.json
Normal 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"}
|
|
@ -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}
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue