Skip to content

Commit

Permalink
Maintenance release. Bumped version to v1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Mar 9, 2015
1 parent cb6b620 commit 8f0234e
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 45 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: node_js
node_js:
- "0.10"
- 0.12
- iojs
before_install:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.3.2 2015-03-09

Maintenance release, upgraded dependencies. Replaced simplesmtp based tests with smtp-server based ones.

## v1.3.0 2014-09-12

Maintenance release, upgrades buildmail and libmime. Allows using functions as transform plugins and fixes issue with unicode filenames in Gmail.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011-2014 Andris Reinman
Copyright (c) 2011-2015 Andris Reinman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodemailer",
"version": "1.3.1",
"version": "1.3.2",
"description": "Easy as cake e-mail sending from your Node.js applications",
"main": "src/nodemailer.js",
"scripts": {
Expand All @@ -26,24 +26,24 @@
},
"homepage": "http://www.nodemailer.com",
"devDependencies": {
"chai": "~2.1.0",
"grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.11.0",
"grunt-mocha-test": "~0.12.7",
"chai": "^2.1.1",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.11.0",
"grunt-mocha-test": "^0.12.7",
"nodemailer-dkim": "^1.0.2",
"nodemailer-markdown": "^1.0.0",
"nodemailer-stub-transport": "^0.1.5",
"simplesmtp": "^0.3.35",
"sinon": "^1.12.2"
"smtp-server": "^1.1.0",
"sinon": "^1.13.0"
},
"dependencies": {
"buildmail": "^1.2.0",
"buildmail": "^1.2.1",
"hyperquest": "^1.0.1",
"libmime": "^0.1.7",
"nodemailer-direct-transport": "^1.0.1",
"nodemailer-smtp-transport": "^1.0.0"
"nodemailer-direct-transport": "^1.0.2",
"nodemailer-smtp-transport": "^1.0.2"
},
"engines": {
"node": ">=0.10.0"
}
}
}
80 changes: 48 additions & 32 deletions test/nodemailer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var sinon = require('sinon');
var http = require('http');
var fs = require('fs');
var expect = chai.expect;
var simplesmtp = require('simplesmtp');
var SMTPServer = require('smtp-server').SMTPServer;
var crypto = require('crypto');

chai.config.includeStack = true;
Expand Down Expand Up @@ -314,44 +314,60 @@ describe('Nodemailer integration tests', function() {
var server;

beforeEach(function(done) {
server = new simplesmtp.createServer({
ignoreTLS: true,
disableDNSValidation: true,
requireAuthentication: true,
debug: false,
authMethods: ['PLAIN', 'XOAUTH2']
});

server.on('startData', function(connection) {
connection.hash = crypto.createHash('md5');
});

server.on('data', function(connection, chunk) {
connection.hash.update(chunk.toString('utf-8'));
});

server.on('dataReady', function(connection, callback) {
var hash = connection.hash.digest('hex');
callback(null, hash); // ABC1 is the queue id to be advertised to the client
});

server.on('authorizeUser', function(connection, username, pass, callback) {
callback(null, username === 'testuser' && (pass === 'testpass' || pass === 'testtoken'));
});

server.on('validateSender', function(connection, email, callback) {
callback(!/@valid.sender/.test(email) && new Error('Invalid sender'));
});
server = new SMTPServer({
authMethods: ['PLAIN', 'XOAUTH2'],
disabledCommands: ['STARTTLS'],

onData: function(stream, session, callback) {
var hash = crypto.createHash('md5');
stream.on('data', function(chunk) {
hash.update(chunk);
});
stream.on('end', function() {
callback(null, hash.digest('hex'));
});
},

server.on('validateRecipient', function(connection, email, callback) {
callback(!/@valid.recipient/.test(email) && new Error('Invalid recipient'));
onAuth: function(auth, session, callback) {
if (auth.method !== 'XOAUTH2') {
if (auth.username !== 'testuser' || auth.password !== 'testpass') {
return callback(new Error('Invalid username or password'));
}
} else {
if (auth.username !== 'testuser' || auth.accessToken !== 'testtoken') {
return callback(null, {
data: {
status: '401',
schemes: 'bearer mac',
scope: 'my_smtp_access_scope_name'
}
});
}
}
callback(null, {
user: 123
});
},
onMailFrom: function(address, session, callback) {
if (!/@valid.sender/.test(address.address)) {
return callback(new Error('Only [email protected] is allowed to send mail'));
}
return callback(); // Accept the address
},
onRcptTo: function(address, session, callback) {
if (!/@valid.recipient/.test(address.address)) {
return callback(new Error('Only [email protected] is allowed to receive mail'));
}
return callback(); // Accept the address
},
logger: false
});

server.listen(PORT_NUMBER, done);
});

afterEach(function(done) {
server.end(done);
server.close(done);
});

it('should log in and send mail', function(done) {
Expand Down

0 comments on commit 8f0234e

Please sign in to comment.