ProtonMail / gluon

An IMAP server library written in Go
MIT License
455 stars 27 forks source link

LSUB command does not respect INBOX #331

Closed sysadmin1139 closed 1 year ago

sysadmin1139 commented 1 year ago

Gnome Evolution isn't working with the updated ProtonBridge. Debug logging shows this series of commands

[imapx:B] I/O: LOGIN...
[imapx:B] I/O: 'B00055 OK [CAPABILITY IDLE IMAP4rev1 MOVE STARTTLS UIDPLUS UNSELECT] Logged in'
[imapx:B] I/O: 'B00056 LIST "" INBOX'
[imapx:B] I/O: 'B00056 OK LIST'
[imapx:B] I/O: 'B00057 LSUB "" INBOX'
[imapx:B] I/O: 'B00057 OK LSUB'
[imapx:B] I/O: 'B00058 LIST "" INBOX'
[imapx:B] I/O: 'B00058 OK LIST'
[imapx:B] I/O: 'B00059 LSUB "" INBOX'
[imapx:B] I/O: 'B00059 OK LSUB'

The symptom inside Evolution is no visible folders. This is new for the Gluon version of ProtonBridge. Emulating this through IMAP literals by way of openssl s_client -connect localhost:1143 -starttls imap -crlf I can reproduce this.

A007 LSUB "" INBOX
A007 OK LSUB

Indicating no folders. Experimenting with other parameters I can get a folder list through:

A0005 LSUB "" "*"
* LSUB (\Unmarked) "/" "Folders/bulk"
* LSUB (\Archive \Noinferiors \Unmarked) "/" "Archive"
* LSUB (\Marked) "/" "Folders/notices"
* LSUB (\Marked) "/" "Folders/drips"
* LSUB (\Marked) "/" "Folders/susefactory"
* LSUB (\Junk \Noinferiors \Unmarked) "/" "Spam"
* LSUB (\Drafts \Noinferiors \Unmarked) "/" "Drafts"
* LSUB (\Flagged \Noinferiors \Unmarked) "/" "Starred"
* LSUB (\Marked \Noinferiors \Trash) "/" "Trash"
* LSUB (\Noselect \Unmarked) "/" "Folders"
* LSUB (\Marked \Noinferiors \Sent) "/" "Sent"
* LSUB (\Noselect \Unmarked) "/" "Labels"
A0005 LSUB OK

This looks like Gluon is not respecting RFCs.

A0001 OK [CAPABILITY IDLE IMAP4rev1 MOVE STARTTLS UIDPLUS UNSELECT] Logged in

IMAP4rev1 is defined in RFC3501. Section 5.1 includes this definition

The case-insensitive mailbox name INBOX is a special name reserved to mean "the primary mailbox for this user on this server". The interpretation of all other names is implementation-dependent.

LBeernaertProton commented 1 year ago

Hey @sysadmin1139 for issues related to the Bridge, please open a ticket in the Bridge's issue tracker.

I'm using evolution with Bridge and I have no issues.