rust-imap icon indicating copy to clipboard operation
rust-imap copied to clipboard

Adding support for Gmail extensions

Open CrispinStichart opened this issue 3 years ago • 6 comments

Gmail added a few non-standard extensions to the IMAP protocol, for handling labels and a few other things.

What's this project's stance on supporting non-standard extensions?

CrispinStichart avatar Mar 28 '22 17:03 CrispinStichart

I'm not against adding these in, probably behind a trait of some kind so that users have to explicitly say they want access to those methods. Or maybe better yet, through a

impl Session {
    fn gmail(&mut self) -> Option<GmailClientExtensions<'_>> {}
}

which returns None if the appropriate capability is present on the server.

jonhoo avatar Apr 02 '22 00:04 jonhoo

Okay, cool. I'll give it a shot. ^_^

CrispinStichart avatar Apr 02 '22 00:04 CrispinStichart

Well, that was easy -- it turns out that support for Gmail labels (which was the only thing I care about) was added to imap-proto a couple of months ago.

Unfortunately, they haven't made a release yet that includes those changes.

In the meantime, I forked rust-imap, switched the imap-proto dependency to pull from the git, and did what needed to be done: https://github.com/CrispinStichart/rust-imap/commit/6e5ec17be5184e1ddd0f3f41b7c1cd5bf5c570d4

You'll notice I deleted NameAttributes entirely, because imap-proto implemented that with this commit: https://github.com/djc/tokio-imap/commit/4f60707e4e81982dae1d1a6820628357d2e81154

CrispinStichart avatar Apr 05 '22 17:04 CrispinStichart

@djc Any chance we could have a new imap-proto release with the label changes?

jonhoo avatar Apr 05 '22 21:04 jonhoo

I just published imap-proto 0.16 to crates.io.

djc avatar Apr 06 '22 07:04 djc

Thank, djc!

I made a pull request for this: https://github.com/jonhoo/rust-imap/pull/225

CrispinStichart avatar Apr 06 '22 23:04 CrispinStichart