node-imap icon indicating copy to clipboard operation
node-imap copied to clipboard

Partial bodies

Open pmccarren opened this issue 10 years ago • 6 comments

Added the ability to fetch partial bodies. Ex: 'TEXT<0.2048>'

pmccarren avatar Jun 17 '15 19:06 pmccarren

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.

mscdex avatar Jun 17 '15 20:06 mscdex

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 :)

pmccarren avatar Jun 17 '15 20:06 pmccarren

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.

mscdex avatar Jun 17 '15 20:06 mscdex

@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?

pmccarren avatar Jun 25 '15 13:06 pmccarren

@pmccarren What problem is that?

mscdex avatar Jul 21 '15 04:07 mscdex

+1 on adding partial BODY FETCH response regex pattern.

This works:

RE_BODYLITERAL = /BODY\[(.*)\](?:<(\d+)>)? \{(\d+)\}/i;

kael avatar Nov 11 '19 07:11 kael