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 4C19311EEFE for <~rjarry/aerc-devel@lists.sr.ht>; Sun, 10 Jul 2022 01:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2020-07-31; bh=k9GcCK3+T NT7yegDxQ3W0oQd/FROzRHhmcR1Y87d7Qw=; h=cc:in-reply-to:references:to: from:subject:date; d=falsifian.org; b=K5kaaxVA+Oj4q9lESGRGp/zQIGOvFD5c F2ycE+DTnQHHiaWzaLmjyn4+VMgyAnuwulnVIjcsp4s6w7dPrE+mKR4Pg51VyNOPUMEyJd fmFBV79A2hQ3WUF9W7rLPLLQoB1xW2Pt1DY/u38Ar9oGaFYzAVC20r1fo+z8t0TqqRv4fz Gptz1CSUMdxs9BCC37wQyoH1mGJLwWOthssYVHbTpnIyb4mlO7vuyuikL2Pd4trRS8DVEP jumJBRokfWq/EvQkTBzTGzmeRK3QuyX6atTMj2Ob6tJxI6lms7EvpdJHvrwfk7bzc/xphQ m0QNB5MJfFboRn+YyW325Cxwh0epqA== Received: from moth.falsifian.org (cpef81d0f9cb2f3-cmf81d0f9cb2f0.cpe.net.fido.ca [72.140.58.252]) by exoco.falsifian.org (OpenSMTPD) with ESMTPSA id 64e3e322 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 10 Jul 2022 01:48:19 +0000 (UTC) Received: from localhost (moth.falsifian.org [local]) by moth.falsifian.org (OpenSMTPD) with ESMTPA id 5d0f4d3f; Sun, 10 Jul 2022 01:48:16 +0000 (UTC) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sun, 10 Jul 2022 01:48:16 +0000 Message-Id: Subject: Re: [PATCH aerc] Allow not marking viewed messages as seen. From: "James Cook" To: "Tim Culverhouse" , <~rjarry/aerc-devel@lists.sr.ht> X-Mailer: aerc 0.10.0-61-g4240f1f-dirty References: <20220705060618.68685-1-falsifian@falsifian.org> In-Reply-To: Cc: On Fri Jul 8, 2022 at 5:57 PM UTC, Tim Culverhouse wrote: > On Tue Jul 5, 2022 at 1:06 AM CDT, James Cook wrote: > > Fixes: https://todo.sr.ht/~rjarry/aerc/48 > > Signed-off-by: James Cook > > Thanks for the patch James! I tested this on imap, maildir, and notmuch > backends. It works as expected for maildir and notmuch. > > The imap backend still marks the messages as read, however. The issue is > that imap servers set the \Seen flag when any part of the body is > fetched (see https://datatracker.ietf.org/doc/html/rfc3501#section-6.4.5) > > I suspect we'll need to remove the flag after fetching for imap > backends. > > The rest looked good to me! > > Tim Thanks for testing it! Looking at that IMAP RFC link, I think the right thing to do is to fetch BODY.PEEK instead of BODY. Maybe aerc could always fetch BODY.PEEK instead of BOD, so setting \Seen is always deliberate. I've never written code that speaks IMAP so take this all with a grain of salt. (I see "BODY.PEEK" appears in isync's source [0] though I haven't looked carefully.) FYI I've been using this patch with aerc's notmuch backend since I sent it, and haven't had any trouble. --=20 James [0] https://sourceforge.net/p/isync/isync/ci/master/tree/src/drv_imap.c