From ae474885f7b2f13f186d40786e962c97e997e131 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Thu, 25 Aug 2022 14:36:35 +0300 Subject: [PATCH] email: add yandex and office365 email flavors --- modules/accounts/email.nix | 44 +++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/modules/accounts/email.nix b/modules/accounts/email.nix index 95539d5c7..05edf8f8a 100644 --- a/modules/accounts/email.nix +++ b/modules/accounts/email.nix @@ -229,7 +229,14 @@ let }; flavor = mkOption { - type = types.enum [ "plain" "gmail.com" "runbox.com" "fastmail.com" ]; + type = types.enum [ + "plain" + "gmail.com" + "runbox.com" + "fastmail.com" + "yandex.com" + "outlook.office365.com" + ]; default = "plain"; description = '' Some email providers have peculiar behavior that require @@ -378,6 +385,41 @@ let maildir = mkOptionDefault { path = "${name}"; }; } + (mkIf (config.flavor == "yandex.com") { + userName = mkDefault config.address; + + imap = { + host = "imap.yandex.com"; + port = 993; + tls.enable = true; + }; + + smtp = { + host = "smtp.yandex.com"; + port = 465; + tls.enable = true; + }; + }) + + (mkIf (config.flavor == "outlook.office365.com") { + userName = mkDefault config.address; + + imap = { + host = "outlook.office365.com"; + port = 993; + tls.enable = true; + }; + + smtp = { + host = "smtp-mail.outlook.com"; + port = 587; + tls = { + enable = true; + useStartTls = true; + }; + }; + }) + (mkIf (config.flavor == "fastmail.com") { userName = mkDefault config.address;