-
Notifications
You must be signed in to change notification settings - Fork 383
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
Partial bodies #480
base: master
Are you sure you want to change the base?
Partial bodies #480
Conversation
This isn't very feasible unfortunately because of how (from what I've seen and how I interpret the RFC) IMAP servers return partial bodies. Basically it boils down to there being no real way to match up partial bodies that start from the same starting offset because the servers only return the starting offset for partial bodies. |
I use it for the use cause when someone has a huge, literally over 50MB, inline attachment. It allows me to not receive the full body from the server, saving precious resources :) |
I agree it can be useful. The only way I see this working generally though is we would have to disallow fetching multiple partial bodies that start at the same offset. |
@@ -45,7 +45,8 @@ var MAX_INT = 9007199254740992, | |||
RE_BACKSLASH = /\\/g, | |||
RE_DBLQUOTE = /"/g, | |||
RE_ESCAPE = /\\\\/g, | |||
RE_INTEGER = /^\d+$/; | |||
RE_INTEGER = /^\d+$/, | |||
RE_PARTIAL_BODY = /^(TEXT)(<[0-9]+\.[0-9]+>)$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that partial fetches are limited strictly to TEXT
.
@mscdex Good idea with allowing all body types. Now I'm running into an issue where the parser has trouble parsing the bodies being returned. Would you be willing to help me get this resolved? |
@@ -12,7 +12,7 @@ var CH_LF = 10, | |||
EMPTY_READCB = function(n) {}, | |||
RE_INTEGER = /^\d+$/, | |||
RE_PRECEDING = /^(?:(?:\*|A\d+) )|\+ ?/, | |||
RE_BODYLITERAL = /BODY\[(.*)\] \{(\d+)\}$/i, | |||
RE_BODYLITERAL = /BODY\[(.*)\](<[0-9]+>)* \{(\d+)\}$/i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The *
operator in this change isn't correct I think. There is only ever one set of <
and >
. It should instead be a ?
to make it optional.
@pmccarren What problem is that? |
+1 on adding partial BODY FETCH response regex pattern. This works: RE_BODYLITERAL = /BODY\[(.*)\](?:<(\d+)>)? \{(\d+)\}/i; |
Added the ability to fetch partial bodies. Ex: 'TEXT<0.2048>'