Recently I came across an odd error in the parser, which looked like this:
TypeError: list[i].toLowerCase is not a function
at Parser.parseFetch (.../node_modules/imap/lib/Parser.js:433:19)
at Parser._resUntagged (.../node_modules/imap/lib/Parser.js:257:24)
at Parser._parse (.../node_modules/imap/lib/Parser.js:137:16)
at Parser._tryread (.../node_modules/imap/lib/Parser.js:82:15)
at Parser._parse (.../node_modules/imap/lib/Parser.js:162:10)
at Parser._tryread (.../node_modules/imap/lib/Parser.js:82:15)
at Parser._parse (.../node_modules/imap/lib/Parser.js:162:10)
at Parser._tryread (.../node_modules/imap/lib/Parser.js:82:15)
at TLSSocket.Parser._cbReadable (.../node_modules/imap/lib/Parser.js:53:12)
at TLSSocket.emit (node:events:513:28)
error Command failed with exit code 1.
It happened when I was trying to fetch some old messages from an account on mail[.]ru server.
I enabled debug output plus added a few logs from myself, trying to look at what exactly caused the error, and here is what it looked like:
I'm not an expert in IMAP, but that second array with that alternative bodystructure seemed wrong to me. I could not find any reference saying that this is a standard behavior. It looks more like a bug in that specific IMAP server implementation.
The exception turned out quite hard to fight, as it's happening deep in the asynchronous code. And also I didn't care too much about the integrity of this this specific email, so this workaround served me well.
Not sure how useful it is here though, since I'm seemingly the only person so far, facing this specific problem.
Hey @AdriandeCita, I ran into the same issue, and it's been a nightmare. Would you be available to fork it and maintain it together? Maybe in TypeScript and solidified
Recently I came across an odd error in the parser, which looked like this:
It happened when I was trying to fetch some old messages from an account on mail[.]ru server.
I enabled debug output plus added a few logs from myself, trying to look at what exactly caused the error, and here is what it looked like:
I'm not an expert in IMAP, but that second array with that alternative bodystructure seemed wrong to me. I could not find any reference saying that this is a standard behavior. It looks more like a bug in that specific IMAP server implementation.
The exception turned out quite hard to fight, as it's happening deep in the asynchronous code. And also I didn't care too much about the integrity of this this specific email, so this workaround served me well.
Not sure how useful it is here though, since I'm seemingly the only person so far, facing this specific problem.