Skip to content

email-in node crashed node-red #1130

@andysc

Description

@andysc

Which node are you reporting and issue on?

This only happened once, so I'm sorry it's hard to reproduce.
I have a mail-in node, configured like this:

Image

One time (I might have been on a dodgy internet connection on a train), node-red crashed with this error message:

[red] Uncaught Exception:
17 Apr 09:29:41 - [error] TypeError: Cannot read properties of undefined (reading 'type')
    at Parser.<anonymous> (/Users/andysc/.node-red/node_modules/node-red-node-email/node_modules/imap/lib/Connection.js:227:29)
    at Parser.emit (node:events:519:28)
    at Parser._resContinue (/Users/andysc/.node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:296:8)
    at Parser._parse (/Users/andysc/.node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:141:16)
    at Parser._tryread (/Users/andysc/.node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:82:15)
    at Parser._cbReadable (/Users/andysc/.node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:53:12)
    at TLSSocket.emit (node:events:519:28)
    at emitReadable_ (node:internal/streams/readable:834:12)
    at onEofChunk (node:internal/streams/readable:812:5)
    at readableAddChunkPushByteMode (node:internal/streams/readable:466:5)
    at Readable.push (node:internal/streams/readable:392:5)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:231:12)
    at Socket.ondata (node:internal/js_stream_socket:79:22)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)

What are the steps to reproduce?

As mentioned, hard to reproduce - it only happened once - but it was fetching whilst on an iffy wifi connection.

What happens?

Node-red crashed with an uncaught exception.

What did you expect to happen?

Error conditions to be handled gracefully and node-red to continue running.

Example flow

email-in node, configured as shown above, linked to a debug node.

Environment

  • Node-RED version: 4.1.0
  • Node.js version: v22.19.0
  • npm version: 11.6.0
  • Platform/OS: Mac/OS
  • Browser: Safari

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions