Skip to content

Add ID command support#315

Open
bczhc wants to merge 1 commit intojonhoo:mainfrom
bczhc:id-command
Open

Add ID command support#315
bczhc wants to merge 1 commit intojonhoo:mainfrom
bczhc:id-command

Conversation

@bczhc
Copy link
Copy Markdown

@bczhc bczhc commented Mar 14, 2026

This adds a method to send ID command to the server.

Take #296 as an example. Netease 126 email requires id command call before any further commands (though it's a very nonstandard way and no spec enforces this). After this PR, it allows to do so to do a success 126 IMAP login.

fn main() -> anyhow::Result<()> {
    let password = "*";

    let domain = "imap.126.com";
    let client = imap::ClientBuilder::new(domain, 993).connect().unwrap();

    let mut imap_session = client.login("bczhc0@126.com", password).map_err(|e| e.0)?;

    let params = [
        ("version", Some("1.0.0")),
        ("vendor", None),
        ("name", None),
    ];

    let _id_response = imap_session.id(&params)?;
    imap_session.examine("INBOX")?;

    imap_session.logout()?;
    Ok(())
}

Fixes #151.


This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for RFC 2971 ID extension

1 participant