From 363c46b2480f1b73ec37cf68caac61f5daa82a2e Mon Sep 17 00:00:00 2001 From: Pavel Borzenkov Date: Wed, 22 Mar 2023 13:25:02 +0300 Subject: [PATCH] programs/alot: make Sent and Drafts folder optional (#3798) Some of the email providers (like GMail and Fastmail) save Sent messages automatically, so make the folders optional in the configuration. Make Drafts folder optional as well, to allow it to be configured manually in the extraConf with location outside of the maildir. --- modules/accounts/email.nix | 2 +- modules/programs/alot.nix | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/accounts/email.nix b/modules/accounts/email.nix index 2d158a21..897aef6d 100644 --- a/modules/accounts/email.nix +++ b/modules/accounts/email.nix @@ -321,7 +321,7 @@ let }; drafts = mkOption { - type = types.str; + type = types.nullOr types.str; default = "Drafts"; description = '' Relative path of the drafts mail folder. diff --git a/modules/programs/alot.nix b/modules/programs/alot.nix index 0cc20ec6..22a29be1 100644 --- a/modules/programs/alot.nix +++ b/modules/programs/alot.nix @@ -68,7 +68,9 @@ let realname = realName; sendmail_command = optionalString (alot.sendMailCommand != null) alot.sendMailCommand; + } // optionalAttrs (folders.sent != null) { sent_box = "maildir" + "://" + maildir.absPath + "/" + folders.sent; + } // optionalAttrs (folders.drafts != null) { draft_box = "maildir" + "://" + maildir.absPath + "/" + folders.drafts; } // optionalAttrs (aliases != [ ]) { aliases = concatStringsSep "," aliases;