andris9/buildmail — pull request #2 by codazzo (2014-12-23 16:56:02+00:00)
Title: Pipe 'error' event from content to output stream

Currently if the content stream triggers an 'error' event (this can happen for a number of reasons), users of Nodemailer have no means to be notified of this. This PR proxies 'error' event from the content stream to the output stream so that transports can themselves detect and handle this error.
I have removed some code that seemed duplicate and done (what seemed to me like) very minimal cleanup. The changes are atomic and broken down by commit.
A PR for each transport will follow shortly.