Gnus development mailing list
 help / color / mirror / Atom feed
From: "Jakub Ječmínek" <kuba@kubajecminek.cz>
To: ding@gnus.org
Subject: ProtonMail Bridge Patch
Date: Sat, 17 Feb 2024 17:29:24 +0000	[thread overview]
Message-ID: <86msrzknim.fsf@kubajecminek.cz> (raw)

Hello,
I'm not sure if this is the correct place to post this but I wish there
was this information somewhere like a week ago.

I recently switched my mail provider to ProtonMail which lets you use
IMAP/SMTP protocol only if you run something called ProtonMail Bridge on
your machine. This software basically acts as a local IMAP/SMTP server
and communicates with the upstream servers in a secured fashion (or at
least this is the rationale).

The problem is that Gnus and Gluon - IMAP server embedded inside
ProtonMail Bridge - doesn't work well together. Gnus (nnimap back end)
was acting like a lunatic and it took me a while before I found the real
reason for its behaviour.

Gnus expects that the messages are returned from a FETCH request in a
ascending (predictable?) order but Gluon responds each time
differently. Example communication might look like this:

Gnus: FETCH 1:3 ...
Gluon: * 3 RESPONSE ...
Gluon: * 1 RESPONSE ...
Gluon: * 2 RESPONSE ...

This is apparently a valid response according to RFC 3501. But luckily
for us there's server option inside Gluon which let's you disable
parallelism and ultimately fix message shuffling. Here's the patch for
proton-bridge package:

From 23f9c69a1552af1f946687f55de901488a2c9a38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Je=C4=8Dm=C3=ADnek?= <kuba@kubajecminek.cz>
Date: Fri, 16 Feb 2024 16:07:21 +0100
Subject: [PATCH] Gnus Fix: disable parallelism

---
 internal/services/imapsmtpserver/imap.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/internal/services/imapsmtpserver/imap.go b/internal/services/imapsmtpserver/imap.go
index 63888b51..358173c6 100644
--- a/internal/services/imapsmtpserver/imap.go
+++ b/internal/services/imapsmtpserver/imap.go
@@ -120,6 +120,7 @@ func newIMAPServer(
 		gluon.WithReporter(reporter),
 		gluon.WithUIDValidityGenerator(uidValidityGenerator),
 		gluon.WithPanicHandler(panicHandler),
+		gluon.WithDisableParallelism(),
 	)
 	if err != nil {
 		return nil, err
-- 
2.42.0

-- 
Kuba Ječmínek
<http://kubajecminek.cz>



             reply	other threads:[~2024-02-17 17:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17 17:29 Jakub Ječmínek [this message]
2024-02-17 18:05 ` Eric Abrahamsen
2024-02-17 18:44   ` Jakub Ječmínek
2024-02-18 17:43     ` Eric Abrahamsen
2024-02-18 17:57       ` Jakub Ječmínek
2024-02-18 18:30         ` Eric Abrahamsen
2024-02-20 11:59           ` Jakub Ječmínek
2024-02-22 17:18             ` Eric Abrahamsen
2024-02-22 22:46               ` Jakub Ječmínek
2024-02-23  2:23                 ` Eric Abrahamsen
2024-02-23 11:57                   ` Jakub Ječmínek
2024-02-19 18:23         ` Bjørn Mork
2024-02-19 21:40           ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86msrzknim.fsf@kubajecminek.cz \
    --to=kuba@kubajecminek.cz \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).