Subject: [imapext] Fwd: About connection pooling

From: Rohan Mehta <[email-masked]>
Date: Wed, 23 Sep 2020 23:51:24 +0530

Hi team,
Hope everyone is well and healthy.

We have IMAP implementation in place for our webmail suite. We now have a
few of our customers using mail suite in mobile devices. So we are planning
optimize the flow for mobile devices. We are wondering why connection
pooling is not a part of IMAP protocol in rfc itself, Is there any reason
behind this? We have seen many wrappers around IMAP pooling in multi
threaded environments like Java, but we are planning to do it in single
threaded environment. Any suggestions and tips will be highly appreciated.

Rohan Mehta
9888850580

---

From: Arnt Gulbrandsen <[email-masked]>
Date: Sun, 27 Sep 2020 16:31:25 +0200

Connection pooling isn't in the protocol because it adds complexity and 
doesn't save significant resources.

IMAP says: Starting at successful login, all commands on a connection use 
the credentials of a single user. That's a simple model.

It simplifies the protcol and some server implementations. A server that 
wishes to process commands for several users can accept commands on several 
connections and get effectively the same resource usage as it would get by 
using a single connection.

Arnt

---

From: "Bron Gondwana" <[email-masked]>
Date: Mon, 28 Sep 2020 11:13:32 +1000

Having said that, there is https://datatracker.ietf.org/doc/rfc8437/ if you really want to reuse the socket.  It doesn't let you multiplex commands for different users without logging out and back in again.  And most IMAP servers won't support that because it's very new.

Bron.

On Mon, Sep 28, 2020, at 00:31, Arnt Gulbrandsen wrote:
> _______________________________________________
> imapext mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/imapext
> 

--
  Bron Gondwana, CEO, Fastmail Pty Ltd
  [email-masked]

---

From: Rohan Mehta <[email-masked]>
Date: Wed, 30 Sep 2020 08:47:00 +0530

Hi Arnt,
Thanks for providing your views.
We have seen a few implementations of IMAP using connection pooling around. That’s was our point of digging out, so thanks again. We will plan accordingly.

Rohan Mehta

---

From: Arnt Gulbrandsen <[email-masked]>
Date: Wed, 30 Sep 2020 13:18:08 +0200

On Wednesday 30 September 2020 05:17:00 CEST, Rohan Mehta wrote:
> We have seen a few implementations of IMAP using connection 
> pooling around. That’s was our point of digging out, so thanks 
> again. We will plan accordingly.

I believe that my response reflects not my opinion, but rather the opinion 
of the author of RFC 3501. (He's no longer around to respond himself, 
unfortunately.)

FYI I've written an implenmentation that pools connections myself, but it 
doesn't pool IMAP conections. I suggest that you look closely at the code 
you have found. If you find IMAP connection pooling I would be very 
interested in the precise command sequences it sends.

Arnt

---

From: "Bron Gondwana" <[email-masked]>
Date: Wed, 30 Sep 2020 21:11:06 +1000

> interested in the precise command sequences it sends.

For what it's worth, we "pool" IMAP connections internally in our systems at Fastmail, but each connection is authenticated as a specific user and is only reused by future commands for the same user.  We don't reuse ever reuse the same connection to access data from a different user.

Bron.