imapclient: Add a convenience function to enable whatever go-imap supports#734
imapclient: Add a convenience function to enable whatever go-imap supports#734arnt wants to merge 1 commit intoemersion:v2from
Conversation
…ports. This allows a client to trust go-imap's judgment and not clutter its source with extension lists.
|
I woke up this morning with mixed feelings. This is a protocol, in the old Microsoft sense of the word: A series of function calls that don't necessarily make overwhelming sense to the user. This mentions 9051 and not 3501, but the code uses 3501 by default and (this is a three-step protocol description ⇒) to use 9051, you dial, login and then call EnableAll. Why that last? It makes sense to people with deep IMAP expertise, less sense to a more general audience. A typical "protocol" sequence of calls. I'd like to do two things:
This would simplify the API, make all client applications use the same set of extensions, and eliminate the possibility of bugs such as happen when people have the same SeqNum for different messages. What do you think? |
I completely agree! (This was part of #491) We should probably provide a way to override this - e.g. with a customizable list of extensions to enable on connect in
FWIW, we already ensure UID is always populated for UID FETCH: Line 46 in 7ac47a9 I don't know if we should be enabling |
|
Enable |
|
It's a digression, perhaps, but on the subject of UIDONLY: Enabling
IMO ③ outweighs ② by a very large factor, and ① is potentially helpful (SELECTing a large folder via IMAP is none too fast). |
|
To somewhat mitigate ③, go-imap has a separate While we're talking about seqnums, I had a question for a while: how does one implement paging without seqnums? The alps webmail needs to display pages of messages. Each page needs to display a fixed number of messages. This is straightforward using seqnums. How does one implement the same functionality with |
|
Indeed, IMAP implements paging via sequence numbers, removing them will require the client to maintain full local message list and do paging locally. Sequence numbers allow storing very little data on the client - UI operations directly correspond to IMAP commands. |
|
Using sequence numbers was the recommended way to implement paging, ie. it was how Mark Crispin intended it to work. I know quite a few clients that did it, including the one I mostly use. However, I also know quite a few clients that stopped doing it, because it causes a poor user experience when you combine it with threading, and people seem to prefer threading over paging when given the choice. If you ask for the 20 latest messages and combine messages into threads, sometimes you display 20 threads and sometimes you display just two threads. There are exceptions — as I mentioned, I use a client that uses paging. This isn't the area I focus on when I analyse IMAP clients, but I don't look away eityher. I don't think there's one single dominant solution. I've seen |
|
Some clients might prefer to display individual messages, and some clients might prefer to show message threads. I don't think go-imap should dictate which UI clients should present to their users. |
|
@emersion your code, your call, of course. My distaste for MSNs may be coloured by my years of answering questions where people get this wrong. MSN arithmetic can be used to paginate messages, but AFAICT most people who paginate messages do it by issuing something like |
|
@emersion I think you may find a message from me in your spam folder. |
|
Hi. Any comments on this? It's magnificently simple. |
|
I would prefer this to be the default, rather than an opt-in. |
|
Makes sense. I can update the PR to silently enable everything unless the client explicitly chooses to enable a (perhaps empty) set of extensions. In that case, how do you prefer to handle the publicly available MSNs? If you ENABLE UIDONLY, you lose MSNs. I see two options:
I don't see a lot of clients use MSNs except when forced to, but they can be useful in principle, so it's a choice. |
This allows a client to trust go-imap's judgment and not clutter its source with IMAP details.