Authentication-Results: mail-b.sr.ht; dkim=pass header.d=falsifian.org header.i=@falsifian.org Received: from exoco.falsifian.org (exoco.falsifian.org [168.235.109.198]) by mail-b.sr.ht (Postfix) with ESMTPS id AF70A11EEF7 for <~rjarry/aerc-devel@lists.sr.ht>; Sat, 20 Aug 2022 00:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2020-07-31; bh=Vz1/orCDP ApWv7Wkp2frwUY/7JW2sDEs1/DWGVucQVE=; h=in-reply-to:references:to:from: subject:date; d=falsifian.org; b=ITTWG5SSs2uhudltgyT6vhqlqDKouqxPwgdnQ wXYku6UOJryoWm/KxSoKNndyoqMk7oC8eCtxPTJjrUtZ1gg+dEnlo1d6QlGH+zT+RF3VpS umxZnwWqO6BlaHCyv2aJ20okmbR9OUgjCeKDNsejm6rj5bIb1m5uZM6DBUIzK8/eCaKd5o 4zvzNI/Sw1PWA2oYNTuOTMsIqafrLoXNL70QW+BsZY+xITSzVLfp0W4GBiSYAvHJ5iqc5W rxTgISXeAA41jdq7ZkNPllJeNysRNE+UYB1O7wY34HUjdGoftdB8NbrV5qTtXpiqrKkgQd kL/Mz7eRehYwgAvu2cAKUX+Mw== Received: from moth.falsifian.org (cpef81d0f9cb2f3-cmf81d0f9cb2f0.cpe.net.fido.ca [72.140.58.252]) by exoco.falsifian.org (OpenSMTPD) with ESMTPSA id e5178216 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 20 Aug 2022 00:31:47 +0000 (UTC) Received: from localhost (moth.falsifian.org [local]) by moth.falsifian.org (OpenSMTPD) with ESMTPA id 9b7aefdb; Sat, 20 Aug 2022 00:31:45 +0000 (UTC) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 20 Aug 2022 00:31:44 +0000 Message-Id: Subject: Re: [PATCH aerc] Use IMAP PEEK and allow not marking messages read. From: "James Cook" To: "James Cook" , <~rjarry/aerc-devel@lists.sr.ht> X-Mailer: aerc 0.11.0-94-ga49578363c98-dirty References: <20220820002218.43914-1-falsifian@falsifian.org> In-Reply-To: <20220820002218.43914-1-falsifian@falsifian.org> On Sat Aug 20, 2022 at 12:22 AM UTC, James Cook wrote: > This commit adds a new configuration option, auto-mark-read, which > defaults to true. When set to false, emails are not marked as seen when > viewed. > > We also fetch BODY.PEEK[...] instead of BODY when fetching messages with > IMAP. This means messages are only marked as read when we deliberately > set the flag (which we automatically anyway, as long as > auto-mark-read=3Dtrue). > > I imagine before this change the export-mbox command caused all messages > in an IMAP folder to be marked as seen. > > Fixes: https://todo.sr.ht/~rjarry/aerc/48 > Signed-off-by: James Cook This patch unconditionally peeks, based on the patch Tim sent*. I chose to make in unconditional for two reasons: 1. aerc already explicitly sets the Seen flag (now as long as auto-mark-read is false). 2. I started integrating Tim's suggested change which adds a "Peek" field to two structs, but I found it added a fair bit of plumbing, because it means whoever is calling the functions that generate those structs needs to pass an extra parameter saying whether Peek should be true. It felt unnecessarily complicated given that my patch is already separately plumbing through the auto-mark-read option. See the comment about export-mbox in the commit message. I considered updating the documentaton to export-mbox to explicitly say it won't cause things to be marked as read, but it seems to me a reasonably user would assume that behaviour anyway. (I didn't actually confirm that the previous behaviour was to mark everything read.) *I should have acknowledged Tim in the commit message; if you commit this version, please add some acknowledgement like "Thanks to Tim Culverhouse for the IMAP PEEK code" to the commit message. --=20 James