chatmail icon indicating copy to clipboard operation
chatmail copied to clipboard

Add IMAP capabilities instead of overwriting them

Open link2xt opened this issue 1 year ago • 5 comments

I wanted to add COMPRESS=DEFLATE, but it should be added only for sessions that are logged in because COMPRESS command does not work before logging in.

Dovecot already does it correctly if we don't overwrite the capability string.

link2xt avatar Sep 22 '24 16:09 link2xt

This is how IMAP session looks like with this change, I don't think this is a significant network overhead compared to TLS hello messages and actual mails:

* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE XDELTAPUSH XCHATMAIL LITERAL+ AUTH=PLAIN] Dovecot (Debian) ready.
? LOGIN [email protected] ...
? OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY PREVIEW STATUS=SIZE SAVEDATE XDELTAPUSH XCHATMAIL LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA] Logged in

link2xt avatar Sep 22 '24 16:09 link2xt

This also enables ID capability which Delta Chat uses to display server ID in connectivity view when it is available.

link2xt avatar Sep 22 '24 19:09 link2xt

I'd prefer if we only list the capabilities we need for a smooth functioning with DC as there is no point sending unused garbage if we control both sides.

hpk42 avatar Sep 23 '24 07:09 hpk42

The other option is adding COMPRESS=DEFLATE to the list, but this is incorrect because COMPRESS is not actually available before login.

link2xt avatar Sep 23 '24 11:09 link2xt

the overhead seems to be roughly 350 bytes -- it's not super-huge i agree, but also i don't see the point of adding ~300 bytes unneccessarily for each imap connection.

hpk42 avatar Oct 11 '24 08:10 hpk42