xpepermint / smtp-client

Simple, promisified, protocol-based SMTP client for Node.js.
36 stars 13 forks source link

Fix starttls bug, update dependencies #5

Closed leftshift closed 4 years ago

leftshift commented 4 years ago

starttls bug

There was a bug expecting the secure method to return a status code. While STARTTLS does return a status code, this is already handled. If a positive result is recieved, a tls connection is negotiated, otherwise, an error is thrown. However, as the RFC states, the server does not send another status code after the successful negotioation, always leading to a Cannot read property 'charAt' of undefined exception in line 325.

Also, as the RFC states, the extensions list has to be reset after STARTTLS. This is mandatory because the server will also drop all state, send regular instead of enhanced status codes, leading to all other further method calls to fail if the library tries to decode them as enhanced status codes.

Also, the docs should probably state another greet() is required after a call to secure() to reestablish the extension list and start a transaction with the mx.

update dependencies

Also, a bunch of deprecation warnings and some vulnerabilities reported by npm audit are fixed by bumping the dependency versions

xpepermint commented 4 years ago

Thanks for the PR. Please make sure tests are passing.

leftshift commented 4 years ago

Sorry about that, the tests now work, I had to update the node version used by the CI to get them to run.

xpepermint commented 4 years ago

smtp-client@0.3.2