Marak / Marak/node_mailer

Unhandled exceptions crashing node

Open
#39 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
385
Forks
60
PR merge metrics
No merged PRs in 30d

Description

I've had a case where two different errors with my smtp server were both resulting in unhandled exceptions that crashed node.

v0.6.4 and node 0.4.8

// First problem happened when Google blocked our account, but this was causing node_error to throw an async unhandled exception

FATALNODEERROR::2011-08-04T06:41:48
STACK:Error: 535-5.7.1 Username and Password not accepted. Learn more at

535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 q4sm1075005ib
b.49
at SMTPClient._dataListener (/usr/local/lib/node/mailer/node_modules/nodemail
er/lib/smtp.js:466:29)
at SMTPClient. (/usr/local/lib/node/mailer/node_modules/nodemailer/lib/smtp.js:643:14)
at CleartextStream. (native)
at CleartextStream.emit (events.js:64:17)
at CleartextStream._push (tls.js:299:12)
at SecurePair.cycle (tls.js:574:20)
at EncryptedStream.write (tls.js:96:13) at Socket.ondata (stream.js:36:26)
at Socket.emit (events.js:64:17) at Socket._onReadable (net.js:678:14)
ARGUMENTS:
TYPE:
MESSAGE:535-5.7.1 Username and Password not accepted. Learn more at

535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 q4sm1075005ib
b.49
TOSTRING:Error: 535-5.7.1 Username and Password not accepted. Learn more at

535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 q4sm1075005ib
b.49

// Second problem was when we switched to a local mail server (exim4) for sending mail and we got this problem

FATALNODEERROR::2011-08-04T07:11:53
STACK:Error: Server responded with 421 admin-01 lost input connection
at SMTPClient._handshakeListener (/usr/local/lib/node/mailer/node_modules/nod
emailer/lib/smtp.js:502:21)
at SMTPClient. (/usr/local/lib/node/mailer/node_modules/nodemailer
/lib/smtp.js:628:21)
at Socket. (native) at Socket.emit (events.js:64:17)
at Socket._onReadable (net.js:678:14) at IOWatcher.onReadable [as callback](net.js:177:10)
ARGUMENTS:
TYPE:
MESSAGE:Server responded with 421 admin-01 lost input connection
TOSTRING:Error: Server responded with 421 admin-01 lost input connection

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading lib/smtp.js around the reported _dataListener line 466 and _handshakeListener line 502, then trace how node_error handles these SMTP responses. Reproduce the Gmail authentication and Exim4 421 cases if the old runtime is available; done means both errors follow the library's normal error path without an unhandled exception crashing Node.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.