Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Exception parsing email with no Date field #118

Closed
rdarden opened this issue Jun 19, 2015 · 0 comments
Closed

Uncaught Exception parsing email with no Date field #118

rdarden opened this issue Jun 19, 2015 · 0 comments
Assignees
Labels

Comments

@rdarden
Copy link

rdarden commented Jun 19, 2015

Node-RED version: v0.10.10
Node.js version: v0.10.36

I have in my inbox for some reason an otherwise valid email with no "date" field in the header. This causes problems such as this when I have a flow that is reading the most recent email from the account in question ("email in"):

19 Jun 13:02:42 - [red] Uncaught Exception:
19 Jun 13:02:42 - TypeError: Cannot read property '0' of undefined
at Readable. (/usr/local/lib/node_modules/node-red/node_modules/node-red-node-email/61-email.js:207:65)
at Readable.emit (events.js:92:17)
at _stream_readable.js:944:16

at process._tickCallback (node.js:442:13)

207 is the "date" line from:

                                    if (info.which !== 'TEXT') {
                                        var head = Imap.parseHeader(buffer);
                                        pay.from = head.from[0];
                                        pay.topic = head.subject[0];
                                        pay.date = head.date[0];
                                        pay.header = head;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants