-
Notifications
You must be signed in to change notification settings - Fork 29
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
Comments
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! :) |
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.
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. |
To follow :) |
Good news, it is official for TLS 1.3 Binding!
Details:
Thanks to @singpolyma who has done a PR in net-sasl for SCRAM: |
Thanks that's great. I'm (slowly, sporadically) working on merging that PR and hope to finish very soon. But let's discuss |
I'm planning on raising a PR soon™ to incorporate the XOAUTH2 authenticator. 👍🏻 |
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
several extensions require this. e.g. non-synchronizing literals
AUTHENTICATE
without matchingAUTH=#{mechanism}
capability #48UTF-7
should be automatically encoded/decoded #30this can be a client option, to preserve backwards compatibility
Only the relevant items are listed below. In some cases, all that we need do for Net::IMAP is add (or link to) documentation.
Net::IMAP doesn't validate number or number64 size, and thus automatically supports the larger 64-bit sizes
IDLE
RFC3516
(2003):BINARY
FETCH
extensions (included inIMAP4rev2
) #41 FETCH BINARYUNSELECT
(included inIMAP4rev2
) #40 UNSELECTRFC4315
(2005):UIDPLUS
(included inIMAP4rev2
) #36 UIDPLUSESEARCH
(included inIMAP4rev2
) #44 ESEARCHSASL-IR
(included inIMAP4rev2
) #34 SASL-IRSEARCHRES
(included inIMAP4rev2
) #42 SEARCHRESENABLE
(included inIMAP4rev2
) #33 ENABLELIST-EXTENDED
(mostly included inIMAP4rev2
) #43 LIST-EXTENDEDLIST-STATUS
(included inIMAP4rev2
) #45 LIST-STATUSSPECIAL-USE
(mailbox attributes are in IMAP4rev2) #108 SPECIAL-USEMOVE
LITERAL-
(included inIMAP4rev2
) #37 LITERAL-These are both numeric status attributes and thus were already implicitly supported.
⚡ Better Faster Cleaner
STATUS
parsing #225 added explicit support and documented both.RFC4731 (2006):
ESEARCH
(included inIMAP4rev2
) #44Support
UIDPLUS
extension #65RFC4466 (2006): Collected Extensions to IMAP4 ABNF #35
RFC6855
(2013):UTF8=ACCEPT
(recommended byIMAP4rev2
for backward compatibility) #38Not applicable:
Net::IMAP
does not interpret unsolicited responses, and leaves this up to the library users.OBJECTID
(recommended by IMAP4rev2) #39CATENATE
CONDSTORE
WITHIN
SEARCHRES
(included inIMAP4rev2
) #42UNAUTHENTICATE
OBJECTID
(recommended by IMAP4rev2) #39IANA registries
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 onCAPABILITY
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 forNet::IMAP
, so "support" simply means parsing and adding the necessary documentation for users ofnet-imap
to implement the extension bevavior. Please comment below if you think something should be promoted to this list!sorted by original RFC year
QUOTA
IDLE
(included inIMAP4rev2
)NAMESPACE
(included inIMAP4rev2
)ID
CHILDREN
MailboxList
predicate methodsBINARY
RFC3516
(2003):BINARY
FETCH
extensions (included inIMAP4rev2
) #41APPEND
command extensionsUNSELECT
(included inIMAP4rev2
) #40ACL
RFC4315
(2005):UIDPLUS
(included inIMAP4rev2
) #36COPYUID
dataAUTH=PLAIN
SORT
ESEARCH
(included inIMAP4rev2
) #44SASL-IR
(included inIMAP4rev2
) #34COMPRESS=DEFLATE
#46AUTH=XOAUTH2
X-GM-EXT-1
deprecated for SPECIAL-USEXLIST
X-GM-RAW
,X-GM-MSGID
,X-GM-THRID
,X-GM-LABELS
n.b. GMail's non-standard extensions can almost be obsoleted by a combination of
OBJECTID
,SORT
,THREAD
,SEARCH=FUZZY
,ESEARCH
,ESORT
, andAUTH=OAUTHBEARER
. But GMail and other large email providers still haven't upgraded to use all of these new standards. Until such time as they are deprecated by GMail (andAUTH=XOAUTH2
is used by many providers), I think it's useful to add these to the standard library instead of installing a separate gem.ENABLE
(included inIMAP4rev2
) #33SEARCHRES
(included inIMAP4rev2
) #42SORT=DISPLAY
(only requires documentation)LIST-EXTENDED
(mostly included inIMAP4rev2
) #43IMAP4rev2
)RFC6855
(2013):UTF8=ACCEPT
(recommended byIMAP4rev2
for backward compatibility) #38AUTH=SCRAM-*
SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) + SCRAM-SHA3-512(-PLUS) supports #54
LIST-STATUS
(included inIMAP4rev2
) #45SPECIAL-USE
(mailbox attributes are in IMAP4rev2) #108MOVE
(included inIMAP4rev2
)AUTH=OAUTHBEARER
#47LITERAL+
(obsoletes: RFC2088 1997)LITERAL-
(included inIMAP4rev2
) #37APPENDLIMIT
UNAUTHENTICATE
STATUS=SIZE
(included inIMAP4rev2
)Net::IMAP
imposes no restrictions onSTATUS
attributes and can parse anyatom number
extension in the response, so it automatically supportsSTATUS mbox (SIZE)
. It is the user's responsibility to check for the capability.$Important
\Important
OBJECTID
(recommended by IMAP4rev2) #39PREVIEW
, Message Preview GenerationQUOTA
(obsoletes RFC2087)PARTIAL
, for Paged SEARCH and FETCHAdditional standard recommendations
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)
JMAPACCESS
Extension for IMAPMESSAGELIMIT
ExtensionDeprecations?
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
require
s, e.g:LOGIN
(only published as a draft. useAUTH PLAIN
orLOGIN
instead)AUTH=CRAM-MD5
AUTH=DIGEST-MD5
- officially obsoleted by RFC6331 (2011)The text was updated successfully, but these errors were encountered: