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

Nodemailer beta 2.0.0 #536

andris9 opened this Issue Dec 31, 2015 · 5 comments


None yet
3 participants
Copy link

andris9 commented Dec 31, 2015

There have been quite a lot of issues regarding Nodemailer updates where some patch level fixes in dependencies break Nodemailer for a lot of users. Thus the release process is going to change in the future to prevent such issues, starting with v2.0.0.

  • All nodemailer core modules reside now in the nodemailer "organization" account in Github. So far these modules were located under my personal account
  • The master branch reflects the latest stable version, all betas reside in appropriate branches. This also fixes the issue where README docs in the project root are not valid for the latest stable.
  • Stable version should include a shrinkwrap file to lock down all dependencies, or alternatively I would define all dependencies in the Nodemailer tree under my control as strict versions, not loose ^ or ~ based numbers ("1.2.3" vs "^1.2.0"), not sure yet. This ensures that downgrading Nodemailer also downgrades any dependencies for Nodemailer.
  • I try to keep external dependency count (where external means not related to the nodemailer project) as low as possible. Currently the remaining external deps are clone and iconv-lite. The latter is not really needed by Nodemailer since Nodemailer never parses, it only generates mime content but it would be a bit difficult to remove it.
  • A new version is not released as latest unless it hasn't been available as beta for at least a week (except there's a breaking/security issue that needs to be fixed right away)

Upcoming changes in v2.0.0

  • All smtp related transports (direct, smtp, pool) are going to be merged into a single built-in transport. All these are not much more than sugaring on top of smtp-connection and smtp is the most used transport anyway.
  • Stream errors are going to break sending. In case of SMTP it would mean to close connection since there is no "cancel" option in SMTP. Current behavior silently embeds error messages as part of the final mime message (if you attach an URL and it returns an error, the error message is set as the contents of this attachment).
  • logging also needs a overhaul, I'm thinking of using bunyan compatible logger interface like in smtp-server
  • adding minimal templating support to send bulk messages based on a template. Instead of providing to/cc/bcc addresses use an array of addressee details and template variable values to send several messages with a single sendMail call not going to happen
  • Anything else?


The logger would not require actual bunyan instances, any object with methods info(), debug() and error() would do. This way you can either provide an actual bunyan object or alternatively create a small wrapper that handles the log calls

var nodemailer = require('nodemailer');
var bunyan = require('bunyan');

var transporter = nodemailer.createTransport({
    service: 'gmail',
    logger: bunyan.createLogger({name: "nodemailer"}),

Version locking

This is the planned dependency tree for nodemailer 2. The two NIH deps are clone and iconv-lite. Both do not have dependencies of their own so locking these with exact version number should work well

├─┬ libmime
│ ├── iconv-lite
│ ├── libbase64
│ └── libqp
├─┬ mailcomposer
│ └─┬ buildmail
│   └── addressparser
├─┬ nodemailer-direct-transport
│ └── smtp-connection
├── nodemailer-fetch
├─┬ nodemailer-smtp-pool
│ ├── clone
│ └── nodemailer-wellknown
└── nodemailer-smtp-transport

@andris9 andris9 added this to the v2 milestone Dec 31, 2015

@andris9 andris9 added the To do label Dec 31, 2015

@andris9 andris9 self-assigned this Dec 31, 2015


This comment has been minimized.

Copy link

bradvogel commented Jan 2, 2016

Thanks so much for this!


This comment has been minimized.

Copy link
Member Author

andris9 commented Jan 4, 2016

Nodemailer 2.0.0 rc.2 is now released in the beta channel. Install with:

npm install nodemailer@beta

v2 readme can be seen here. Nodemailer does not emit 'log' events anymore, everything else should be backwards compatible.

I decided to go with full version locking instead of using package level shrinkwrap file. This is the resulting dependency tree:

└─┬ nodemailer@2.0.0-rc.2
  ├─┬ libmime@2.0.0
  │ ├── iconv-lite@0.4.13
  │ ├── libbase64@0.1.0
  │ └── libqp@1.1.0
  ├─┬ mailcomposer@3.0.1
  │ └─┬ buildmail@3.0.1
  │   └── addressparser@0.3.2
  ├─┬ nodemailer-direct-transport@2.0.0
  │ └── smtp-connection@2.0.0
  ├─┬ nodemailer-shared@1.0.2
  │ └── nodemailer-fetch@1.0.0
  ├─┬ nodemailer-smtp-pool@2.0.0
  │ ├── clone@1.0.2
  │ └── nodemailer-wellknown@0.1.7
  └── nodemailer-smtp-transport@2.0.0

Installed size should be about 1MB


This comment has been minimized.

Copy link
Member Author

andris9 commented Jan 11, 2016

Nodemailer v2.0.0 is now officially released. See the (short) announcement here

@andris9 andris9 closed this Jan 11, 2016


This comment has been minimized.

Copy link

barisusakli commented Jan 12, 2016

Is nodejs 0.10.x supported on v2.0.0?


This comment has been minimized.

Copy link
Member Author

andris9 commented Jan 12, 2016

Yes, 0.10 is supported. I can't run automated tests on 0.10 as some parts of the testing stack require node 0.12 but as much as I have manually verified nodemailer should work fine with node 0.10

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