Skip to content

IMAP: classify standard folders as system labels #198

@wesm

Description

@wesm

Context

The IMAP ListLabels implementation in #193 only marks INBOX as label_type = "system" — all other mailboxes are "user". Standard IMAP folders like Sent, Drafts, Trash, and Junk should also be classified as system labels for consistency with Gmail label handling.

Proposal

Use RFC 6154 special-use attributes (\Sent, \Drafts, \Trash, \Junk, \All, \Archive) to determine label type. Fall back to common folder name matching (e.g. "Sent", "Draft", "Drafts", "Trash", "Bulk Mail") for servers that don't advertise special-use attributes.

Current behavior

client.go:543-548 — only INBOX gets label_type = "system":

labelType := "user"
if item.Mailbox == "INBOX" {
    labelType = "system"
}

References

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