Permalink
Browse files

Don't try to authenticate unless a username is given.

  • Loading branch information...
1 parent 041403c commit 4ca515f37a5c05dc70bb507869c4017c1f05db13 @weaver weaver committed Oct 14, 2010
Showing with 10 additions and 7 deletions.
  1. +9 −6 lib/mail/index.js
  2. +1 −1 package.json
View
@@ -275,13 +275,16 @@ Client.prototype.smtpAUTH = function(next, mechanisms) {
var names = mechanisms.toUpperCase().split(/\s+/),
method;
- for (var i = 0, l = names.length; i < l; i++) {
- method = this['auth' + names[i]];
- if (method) {
- method.call(this, this.username, this.password, next);
- break;
+ if (!this.username)
+ next();
+ else
+ for (var i = 0, l = names.length; i < l; i++) {
+ method = this['auth' + names[i]];
+ if (method) {
+ method.call(this, this.username, this.password, next);
+ break;
+ }
}
- }
};
// LOGIN mechanism <http://www.fehcom.de/qmail/smtpauth.html#FRAMEWORK>
View
@@ -1,7 +1,7 @@
{
"name": "mail",
"description": "This SMTP client library for Node.JS helps you send email safely and easily.",
- "version": "0.1.0",
+ "version": "0.1.1",
"author": "Ben Weaver <ben@orangesoda.net>",
"contributors": [],
"dependencies": {},

0 comments on commit 4ca515f

Please sign in to comment.