From 0a014a729cdd54d9919ff36b714d047909d7a4c8 Mon Sep 17 00:00:00 2001 From: Maxim Karasev <59313755+mxkrsv@users.noreply.github.com> Date: Sat, 5 Aug 2023 11:56:10 +0300 Subject: [PATCH] aerc: do not use smtp-starttls (#4272) It was deprecated in 0.15.0, +insecure schema is suggested instead. Thus, we can just copy imap logic, which already uses +insecure. --- modules/programs/aerc-accounts.nix | 15 +++++++-------- .../modules/programs/aerc/extraAccounts.expected | 5 ++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/modules/programs/aerc-accounts.nix b/modules/programs/aerc-accounts.nix index a40877f5..5c772c2c 100644 --- a/modules/programs/aerc-accounts.nix +++ b/modules/programs/aerc-accounts.nix @@ -177,21 +177,20 @@ in { params = cfg.aerc.smtpOauth2Params; }; - protocol = if smtp.tls.enable && !smtp.tls.useStartTls then - "smtps${loginMethod'}" + protocol = if smtp.tls.enable then + if smtp.tls.useStartTls then + "smtp${loginMethod'}" + else + "smtps${loginMethod'}" else - "smtp${loginMethod'}"; + "smtp+insecure${loginMethod'}"; port' = optPort smtp.port; - smtp-starttls = - if smtp.tls.enable && smtp.tls.useStartTls then "yes" else null; - in { outgoing = "${protocol}://${userName}@${smtp.host}${port'}${oauthParams'}"; - } // optPwCmd "outgoing" passwordCommand - // optAttr "smtp-starttls" smtp-starttls; + } // optPwCmd "outgoing" passwordCommand; msmtp = cfg: { outgoing = "msmtpq --read-envelope-from --read-recipients"; diff --git a/tests/modules/programs/aerc/extraAccounts.expected b/tests/modules/programs/aerc/extraAccounts.expected index a53e6e00..172e3452 100644 --- a/tests/modules/programs/aerc/extraAccounts.expected +++ b/tests/modules/programs/aerc/extraAccounts.expected @@ -38,7 +38,6 @@ source-cred-cmd = echo PaSsWorD! [e_smtp-nopasscmd-tls-starttls] from = Foo Bar outgoing = smtp+plain://foobar@smtp.host.invalid:42 -smtp-starttls = yes [f_smtp-passcmd-tls-nostarttls] from = Foo Bar @@ -47,12 +46,12 @@ outgoing-cred-cmd = echo PaSsWorD! [g_smtp-passcmd-notls-nostarttls] from = Foo Bar -outgoing = smtp+plain://foobar@smtp.host.invalid:42 +outgoing = smtp+insecure+plain://foobar@smtp.host.invalid:42 outgoing-cred-cmd = echo PaSsWorD! [h_smtp-passcmd-notls-starttls] from = Foo Bar -outgoing = smtp+plain://foobar@smtp.host.invalid:42 +outgoing = smtp+insecure+plain://foobar@smtp.host.invalid:42 outgoing-cred-cmd = echo PaSsWorD! [i_maildir-mbsync]