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

**URL:** <https://discourse.nodered.org/t/reading-emails-via-pop3-or-imap-from-localhost-crashes-node-red/65165>\
**Category:** General\
**Created:** [15 July 2022 19:55 UTC](https://discourse.nodered.org/t/reading-emails-via-pop3-or-imap-from-localhost-crashes-node-red/65165 "2022-07-15T19:55:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![papershow](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@papershow](https://discourse.nodered.org/u/papershow)\
**Post date:** [15 July 2022 19:55 UTC](https://discourse.nodered.org/t/reading-emails-via-pop3-or-imap-from-localhost-crashes-node-red/65165/1 "2022-07-15T19:55:23Z")

</div>

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:

```auto
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?

Thanks,  
Toby

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 July 2022 20:24 UTC](https://discourse.nodered.org/t/reading-emails-via-pop3-or-imap-from-localhost-crashes-node-red/65165/2 "2022-07-15T20:24:50Z")

</div>

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](https://nodered.org/docs/faq/node-versions)

---

<div class="post-metadata">

**Author:** ![papershow](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@papershow](https://discourse.nodered.org/u/papershow)\
**Post date:** [15 July 2022 20:30 UTC](https://discourse.nodered.org/t/reading-emails-via-pop3-or-imap-from-localhost-crashes-node-red/65165/3 "2022-07-15T20:30:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 July 2022 20:33 UTC](https://discourse.nodered.org/t/reading-emails-via-pop3-or-imap-from-localhost-crashes-node-red/65165/4 "2022-07-15T20:33:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![papershow](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@papershow](https://discourse.nodered.org/u/papershow)\
**Post date:** [15 July 2022 20:35 UTC](https://discourse.nodered.org/t/reading-emails-via-pop3-or-imap-from-localhost-crashes-node-red/65165/5 "2022-07-15T20:35:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![papershow](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@papershow](https://discourse.nodered.org/u/papershow)\
**Post date:** [15 July 2022 20:46 UTC](https://discourse.nodered.org/t/reading-emails-via-pop3-or-imap-from-localhost-crashes-node-red/65165/6 "2022-07-15T20:46:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 July 2022 20:46 UTC](https://discourse.nodered.org/t/reading-emails-via-pop3-or-imap-from-localhost-crashes-node-red/65165/7 "2022-07-29T20:46:43Z")

</div>

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