Skip to content

Issue when parsing select response flags from surgemail server #178

@cry-inc

Description

@cry-inc

Hello, I created an IMAP client app that uses the imap-proto crate via async-imap. A user reported an IMAP issue when connecting to his server running surgemail. I was able to reproduce the issue with a minimal IMAP client example on my own test instance of surgemail version 80e.

The issue boils down to surgemail sending an extra space at the end of the flags list before the closing ):

< SELECT "INBOX"
<
> * 1 EXISTS
> * 0 RECENT
> * OK [UNSEEN 1] first unseen message
> * OK [UIDVALIDITY 1754171061] Uid epoch
> * OK [UIDNEXT 2] Predicted next uid
> * FLAGS (\Answered \Flagged \Deleted \Draft \Seen $Forwarded )
> * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Draft \Seen $Forwarded )] Limited
> A0002 OK [READ-WRITE] SELECT completed

link2xt (maintainer of async-imap) documented the issue and sent me here.

I was able to trigger the parser error in question using this small test:

#[test]
fn test_flags() {
    super::response_data(b"* FLAGS (\\Answered \\Flagged \\Deleted \\Draft \\Seen $Forwarded )\r\n").unwrap();
}

Is this a case where you would consider adding a workaround for the surgemail bug in imap-proto?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions