Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for IMAP4rev2 and modern extensions #12

Open
nevans opened this issue Nov 14, 2020 · 7 comments
Open

Support for IMAP4rev2 and modern extensions #12

nevans opened this issue Nov 14, 2020 · 7 comments
Labels
IMAP4rev1 Requirement for IMAP4rev1, RFC3501 IMAP4rev2 Requirement for IMAP4rev2, RFC9051
Milestone

Comments

@nevans
Copy link
Collaborator

nevans commented Nov 14, 2020

This is a meta-ticket to track support for IMAP capabilities. I'm also listing capabilities that are already supported by Net::IMAP as well as extensions that are obsolete or unsupported by IMAP servers, so that (when completed) the list will be exhaustive. Later, we can copy the list of supported RFCs and extensions into the rdoc.

This list hasn't been carefully audited yet. Some unchecked items can probably be checked off without any extra effort. As tickets and PRs are created for various features, I'll update this list to include them.

Basic protocol specifications

IANA registries

Registry references
Capabilities RFC3501
Mailbox attributes RFC3501
SASL Mechanisms RFC4422
LIST EXTENDED RFC5258
Response codes RFC5530
Keywords RFC5788, RFC8621

Commonly supported extensions

This is not an exhaustive list of all extensions, but an opinionated selection of the most important extensions that Net::IMAP should support. It is partially based on CAPABILITY data for hundreds of thousands of IMAP4 accounts, and partially based on subjective judgement. Additionally, any RFCs we already support, even if only partially, have been promoted to this list. Some extension behaviors are out-of-scope for Net::IMAP, so "support" simply means parsing and adding the necessary documentation for users of net-imap to implement the extension bevavior. Please comment below if you think something should be promoted to this list!

sorted by original RFC year

Additional standard recommendations

  • RFC2180 - IMAP4 Multi-Accessed Mailbox Practice
  • RFC2595 - Using TLS with IMAP, POP3 and ACAP
  • RFC2683 (1999): IMAP4 Implementation Recommendations
    • mailbox listing, heirarchy, delimiters, NAMESPACE, etc
    • mailbox "\Noselect", "\Noinferiors", "[TRYCREATE]", "[READ-ONLY]"
    • UIDs and UIDVALIDITY
    • FETCH (any order, extra information, unsolicited)
    • "Clients must present ALERT text clearly to the user."
  • RFC4549 (2006): Synchronization Operations for Disconnected IMAP4 Clients
  • RFC5550 (2009): The Internet Email to Support Diverse Service Environments (Lemonade) Profile
    • obsoletes: [RFC4550] (2006)
  • RFC5598 (2009): Internet Email Architecture (Errata Exist)

Other extensions

Some of these are easy to add, and many of them would be very useful. I placed them down here instead of prioritizing them above mostly due to a quick and unscientific sampling of email accounts and server capabilities.

sorted by estimated current server support

By my estimation, the following are currently supported by relatively few email addresses. They are sorted by RFC number.

New specifications

Looking at recent standards and others that are still in draft form (as of 2021-10-19):

IETF "extra" WG (Email mailstore and eXtensions To Revise or Amend)

Deprecations?

We might want to remove obsolete authentication mechanisms from the default set of authenticators. For people who still need them, the code could be preserved in separate files, with explicit requires, e.g:

require "net/imap/sasl/cram-md5_authenticator"
require "net/imap/sasl/digest-md5_authenticator"
require "net/imap/sasl/login_authenticator"
@nevans nevans changed the title Support for modern IMAP specifications Support for IMAP4rev2 and modern extensions Oct 19, 2021
@nevans
Copy link
Collaborator Author

nevans commented Oct 19, 2021

n.b. IMAP4rev2 (RFC9051) was released on 2021-08-26.

I didn't have as much time earlier this year as I'd hoped, but I'll have some more time to devote to this next week and the week after, so hopefully I can make good progress towards updating our parser for IMAP4rev2. I'd like to see what can be accomplished before RubyConf 2021! :)

@nevans
Copy link
Collaborator Author

nevans commented Nov 19, 2021

n.b. I lightly modified RFC-9051's ABNF to valid ABNF syntax, and I generated railroad diagrams in unicode line-art, using kgt: https://gist.github.com/nevans/ae5a82bb81c1595b06b9e167a0376924

e.g.

response:
    │├─────╭─────────────────────────╮── response-done ─────┤│
           │                         │
           ╰──╮── continue-req ───╭──╯
              │                   │
              ╰── response-data ──╯

response-data:
    │├───── "*" ── SP ──╮── resp-cond-state ──╭── CRLF ─────┤│
                        │                     │
                        ╰─── resp-cond-bye ───╯
                        │                     │
                        ╰─── mailbox-data ────╯
                        │                     │
                        ╰─── message-data ────╯
                        │                     │
                        ╰── capability-data ──╯
                        │                     │
                        ╰──── enable-data ────╯

response-done:
    │├──╮── response-tagged ──╭──┤│
        │                     │
        ╰── response-fatal ───╯

response-fatal:
    │├───── "*" ── SP ── resp-cond-bye ── CRLF ─────┤│

response-tagged:
    │├───── tag ── SP ── resp-cond-state ── CRLF ─────┤│

and so on...

I spent a little bit of time this week going through the collection of response parser patches I've been using, to figure out which ones to convert into PRs and which ones to throw away. I hope to start on the big RFC9051 updates next week.

In most cases, the ABNF in RFC9051 seems like an easier starting point than RFC3501, because it already incorporates many of the updates from various popular extensions. And it also includes simpler extension points for the extensions which aren't included. Likewise, I think it will be simpler to retain backwards compatibility with an RFC9051 parser than to force forward compatibility into an RFC3501 parser.

@nevans
Copy link
Collaborator Author

nevans commented Jan 11, 2022

Updated the checklist with links to #55 and #54. Hopefully I'll starting ticking things off this checklist soon, and not only adding things to it! 😆

@Neustradamus
Copy link

To follow :)

@nevans nevans pinned this issue Feb 7, 2022
@Neustradamus
Copy link

Good news, it is official for TLS 1.3 Binding!

Details:

  • tls-unique for TLS =< 1.2
  • tls-exporter for TLS = 1.3

Thanks to @singpolyma who has done a PR in net-sasl for SCRAM:

@nevans
Copy link
Collaborator Author

nevans commented Aug 1, 2022

Thanks that's great. I'm (slowly, sporadically) working on merging that PR and hope to finish very soon. But let's discuss SCRAM-* SASL mechanisms in #54, maybe open a new issue (or PR! 😉) for new features like channel binding, and reserve talk on this issue to be about the meta-ticket: the IMAP4rev2 checklist and extensions that are in one of the specific IMAP IANA registries, e.g: IMAP capabilities.

@ssunday
Copy link
Contributor

ssunday commented Sep 22, 2022

I'm planning on raising a PR soon™ to incorporate the XOAUTH2 authenticator. 👍🏻

nevans referenced this issue in nevans/net-imap Nov 20, 2022
This is needed for IMAP4rev2 #12.

Fixes ruby#40.
nevans added a commit that referenced this issue Nov 21, 2022
This is needed for IMAP4rev2 #12.

Fixes #40.
nevans added a commit that referenced this issue Nov 21, 2022
This is needed for IMAP4rev2 #12.

Fixes #40.
@nevans nevans added IMAP4rev1 Requirement for IMAP4rev1, RFC3501 IMAP4rev2 Requirement for IMAP4rev2, RFC9051 labels Feb 12, 2023
@nevans nevans added this to the v0.6 milestone Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IMAP4rev1 Requirement for IMAP4rev1, RFC3501 IMAP4rev2 Requirement for IMAP4rev2, RFC9051
Development

No branches or pull requests

3 participants