Search code examples
emailimapemail-client

Is there a way to find the IMAP mailbox that contains all mail, regardless of provider?


I was wondering if there exists a way or maybe a convention to figure out what the IMAP mailbox is for each e-mail provider that contains all (non-spam) e-mail.

For GMail it's [Gmail]/All Mail, but it's obviously different for other services.

Does one have to inspect the mailboxes of each service or is there an easier way?


Solution

  • If the server supports RFC 6154, "IMAP LIST Extension for Special-Use Mailboxes", then the results of the LIST command should contain the attribute \All for the mailbox that contains all mail:

    * LIST (\HasNoChildren \All) "/" "[Gmail]/All Mail"
    

    Gmail supports this; not sure which other providers do.