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.
This commit is contained in:
Pavel Borzenkov 2023-03-22 13:25:02 +03:00 committed by GitHub
parent c6a7bc90ca
commit 363c46b248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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.

View File

@ -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;