-
Notifications
You must be signed in to change notification settings - Fork 390
Partial bodies#480
Conversation
mscdex
commented
Jun 17, 2015
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.
pmccarren
commented
Jun 17, 2015
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 :)
mscdex
commented
Jun 17, 2015
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.
lib/Connection.js
Outdated
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.
pmccarren
commented
Jun 25, 2015
@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?
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.
mscdex
commented
Jul 21, 2015
@pmccarren What problem is that?
kael
commented
Nov 11, 2019
+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>'