From a8e2d08ffdc68123316b57cf2ad51244c7eca335 Mon Sep 17 00:00:00 2001 From: ScribblyBirb <2049163+SiriusStarr@users.noreply.github.com> Date: Wed, 7 May 2025 16:17:09 -0700 Subject: [PATCH] alot: allow commas in maildir path (#6989) Previously, maildir path was not escaped in any way, so using a path with commas lead to a TypeError: ``` TypeError: expected string or bytes-like object, got 'list' ``` --- modules/programs/alot.nix | 4 ++-- tests/modules/programs/alot/alot-expected.conf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/programs/alot.nix b/modules/programs/alot.nix index c61784aea..84175f99c 100644 --- a/modules/programs/alot.nix +++ b/modules/programs/alot.nix @@ -96,10 +96,10 @@ let sendmail_command = optionalString (alot.sendMailCommand != null) alot.sendMailCommand; } // optionalAttrs (folders.sent != null) { - sent_box = "maildir" + "://" + maildir.absPath + "/" + folders.sent; + sent_box = "'maildir" + "://" + maildir.absPath + "/" + folders.sent + "'"; } // optionalAttrs (folders.drafts != null) { - draft_box = "maildir" + "://" + maildir.absPath + "/" + folders.drafts; + draft_box = "'maildir" + "://" + maildir.absPath + "/" + folders.drafts + "'"; } // optionalAttrs (aliases != [ ]) { aliases = concatStringsSep "," aliases; diff --git a/tests/modules/programs/alot/alot-expected.conf b/tests/modules/programs/alot/alot-expected.conf index 6d3ace4a3..5b16d3b83 100644 --- a/tests/modules/programs/alot/alot-expected.conf +++ b/tests/modules/programs/alot/alot-expected.conf @@ -26,10 +26,10 @@ prefer_plaintext = True [[hm@example.com]] address=hm@example.com -draft_box=maildir:///home/hm-user/Mail/hm@example.com/Drafts +draft_box='maildir:///home/hm-user/Mail/hm@example.com/Drafts' realname=H. M. Test sendmail_command= -sent_box=maildir:///home/hm-user/Mail/hm@example.com/Sent +sent_box='maildir:///home/hm-user/Mail/hm@example.com/Sent' auto_remove_unread = True ask_subject = False handle_mouse = True