node-red / node-red-nodes

Extra nodes for Node-RED
Other
987 stars 592 forks source link

Reading emails via pop3 or imap from localhost crashes node-red #934

Open fluorescentb opened 2 years ago

fluorescentb commented 2 years ago

Hi all,

I've got a citadel email server running on my raspberry pi along with Node-Red running Pi OS Lite.

Node-Red v3.0.0 Node.js v18.6.0 node-red-email v1.15.1

Every time I try to read email from the local Citadel server via pop3 or imap node-red hard crashes with this error:

15 Jul 21:36:25 - [error] TypeError: Cannot set property errored of #<Readable> which has only a getter
    at new MessageSplitter (/home/papershow/.node-red/node_modules/node-red-node-email/node_modules/mailsplit/lib/message-splitter.js:28:22)
    at new MailParser (/home/papershow/.node-red/node_modules/node-red-node-email/node_modules/mailparser/lib/mail-parser.js:132:25)
    at module.exports (/home/papershow/.node-red/node_modules/node-red-node-email/node_modules/mailparser/lib/simple-parser.js:29:18)
    at POP3Client.<anonymous> (/home/papershow/.node-red/node_modules/node-red-node-email/61-email.js:320:21)
    at POP3Client.emit (node:events:513:28)
    at /home/papershow/.node-red/node_modules/node-red-node-email/poplib.js:721:18
    at Socket.onData (/home/papershow/.node-red/node_modules/node-red-node-email/poplib.js:239:17)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)

This issue does not occur on node.js v14.20.0 or v16.x. This issue was resolved on the forums by downgrading my node.js version but it was suggested I post it here for futureproofing.

Thanks, Toby

hardillb commented 2 years ago

Please use the template provided to enter issue details so all the required information is capture.

Also please edit the initial post so the stack trace is wrapped in tripple back ticks not single so it preserves the line brakes.

(Forum thread for reference https://discourse.nodered.org/t/reading-emails-via-pop3-or-imap-from-localhost-crashes-node-red/65165)

hardillb commented 2 years ago

We should also transfer this to the node-red/node-red-nodes project as that is where node-red-node-email lives