Skip to content

Instantly share code, notes, and snippets.

@amcjen
Created June 22, 2011 19:21
Show Gist options
  • Save amcjen/1040905 to your computer and use it in GitHub Desktop.
Save amcjen/1040905 to your computer and use it in GitHub Desktop.
cur[1].toLowerCase(); fix
// starting around line 1010 in imap.js
} else { // single part
next = 7;
part = {
// the path identifier for this part, useful for fetching specific
// parts of a message
partID: (prefix !== '' ? prefix : '1'),
// required fields as per RFC 3501 -- null or otherwise
type: cur[0].toLowerCase(),
//subtype: cur[1].toLowerCase(),
params: null, id: cur[3], description: cur[4], encoding: cur[5],
size: cur[6]
}
if (cur.length >= 2 && cur[1].toString() === 'String'){
part.subtype = cur[1].toLowerCase();
} else {
part.subtype = null;
}
if (Array.isArray(cur[2])) {
part.params = {};
for (var i=0,len=cur[2].length; i<len; i+=2)
part.params[cur[2][i].toLowerCase()] = cur[2][i+1];
}
if (part.type === 'message' && part.subtype === 'rfc822') {
// envelope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment