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

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

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 20:48:20 - [red] Uncaught Exception:
15 Jul 20:48:20 - [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-variable/node_modules/mailsplit/lib/message-splitter.js:28:22)
    at new MailParser (/home/papershow/.node-red/node_modules/node-red-node-email-variable/node_modules/mailparser/lib/mail-parser.js:132:25)
    at module.exports (/home/papershow/.node-red/node_modules/node-red-node-email-variable/node_modules/mailparser/lib/simple-parser.js:29:18)
    at POP3Client.<anonymous> (/home/papershow/.node-red/node_modules/node-red-node-email-variable/variable-email.js:416:21)
    at POP3Client.emit (node:events:513:28)
    at /home/papershow/.node-red/node_modules/node-red-node-email-variable/node_modules/poplib/main.js:729:9
    at Socket.onData (/home/papershow/.node-red/node_modules/node-red-node-email-variable/node_modules/poplib/main.js:239:5)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Consumed 12.748s CPU time.

I've tested this on my Windows PC connecting to the mail server on my raspberry pi and it works fine. My pc is running Node-Red v2.1.4 and node.js v16.15.1

Does anyone have any idea how I could solve this bug, or is it impossible to run an email server and Node-Red on the same machine?


What version of node-red-node-email-variable are you using? The current is 1.0.6

I see you are using node.js 18 which, unless I have missed an announcement, is not yet recommended, though I suspect that is not the issue. Supported Node versions : Node-RED

I'm using the latest version of node-red-node-email-variable. I changed to that for troubleshooting purposes in case it was the node-red-email palette which had the same issue. To be clear it occurs in both:

node-red-node-email-variable v 1.0.6
node-red-email v1.15.1

I'll downgrade node.js anyway just in case it's that.

Either way it would be worth submitting an issue about it, unless someone sees it here and announces a fix. Soon nodejs 18 will be supported, I expect, so the developers will want to know about any issues with that.

I'll copy this over to github now. thanks for all the help!

Thanks! it did end up being a nodejs version issue, but I'll submit it to github anyway.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.