Ignore OAuth2 errors from destroyed connections #72

merged 1 commit into from Feb 26, 2014

2 participants


Previous fix (#70) only fixed OAuth 1; sorry.
Fully fixes #68

Question: Should this check be moved to _onError(), so that all protocol errors from destroyed connections are silently swallowed? (https://github.com/andris9/simplesmtp/blob/master/lib/client.js#L355)

@SLaks SLaks Ignore OAuth2 errors from destroyed connections
Previous fix only fixed OAuth 1; sorry
@andris9 andris9 merged commit e8ff335 into andris9:master Feb 26, 2014

1 check passed

Details default The Travis CI build passed

Current approach is OK, silently ignoring all issues might be bad in the long term as something major might get unnoticed, better to detect and fix bugs one by one


I'm intermittently getting another error from this:

Error: CryptoStream is not writable
    at CleartextStream.CryptoStream.write (tls.js:259:11)
    at SMTPClient.sendCommand (/home/.../node_modules/nodemailer/node_modules/simplesmtp/lib/client.js:498:17)
    at SMTPClient._actionXOAUTHRetry (/home/.../nodemailer/node_modules/simplesmtp/lib/client.js:911:14)
    at XOAuth2Generator.generateToken (/home/.../node_modules/nodemailer/node_modules/simplesmtp/node_modules/xoauth2/index.js:122:24)
    at IncomingMessage.req.request.res.on.finished (/home/.../node_modules/nodemailer/node_modules/simplesmtp/node_modules/xoauth2/index.js:161:20)
    at IncomingMessage.EventEmitter.emit (events.js:126:20)
    at IncomingMessage._emitEnd (http.js:366:10)
    at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
    at CleartextStream.socketOnData [as ondata] (http.js:1485:20)
    at CleartextStream.CryptoStream._push (tls.js:544:27)
    at SecurePair.cycle (tls.js:898:20)

It seems to be triggered by

AuthError: Invalid login - 454 4.7.0 Too many login attempts, please try again later. p10sm44590551qag.8 - gsmtp

I'm still investigating; looking at the code, it doesn't make much sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment