djc / tokio-imap

Tokio-based IMAP implementation
Apache License 2.0
122 stars 42 forks source link

Add support for googles x-gm-labels extension #137

Closed estriv closed 2 years ago

estriv commented 2 years ago

Hi,

I was using your crate to interact with the Google IMAP server. As I heavily rely on Google's IMAP extensions I started implementing them with X-GM-LABELS.

I would be glad if you accept the changes. Further implementation will be done as I find time and the need.

link2xt commented 2 years ago

Is it possible to also add some generic interface for unknown X- extensions, so imap-proto does not have to grow support for every non-standard extension?

Somewhat related PR, Delta Chat ignores [Gmail] folders mapped to these labels: https://github.com/deltachat/deltachat-core-rust/pull/2587

estriv commented 2 years ago

Yes this would be possible implementing a type for MailboxDatum and AttributeValue that holds a tag name (like "GM-LABELS" oder "GM-THRID") and a variant on a list, string or number. But this, in my eyes, breaks with the design choices of imap-proto as it softens the typing.

estriv commented 2 years ago

@djc What can I do?

djc commented 2 years ago

Have a little patience and not expect me to review your changes immediately when it's Christmas? 😛

estriv commented 2 years ago

Sorry, I thought I messed something up...

djc commented 2 years ago

Well, you should also run cargo fmt on your changes, looks like.

estriv commented 2 years ago

I already did this yesterday and pushed the changes: https://github.com/estriv/tokio-imap/commit/365c6e6971a288bfab9942bb92020e906193ebd9

djc commented 2 years ago

Well, that commit doesn't exist on your PR branch.