Skip to content
This repository
Browse code

Bug fix for auth_capibilities variable definition

  • Loading branch information...
commit 81ec865b898343d31ca5684bb36082bb58349aec 1 parent f90baaa
Matt Sergeant authored

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. +6 5 smtp_client.js
11 smtp_client.js
@@ -303,6 +303,7 @@ exports.get_client_plugin = function (plugin, connection, config, callback) {
303 303 var pool = exports.get_pool(connection.server, config.main.port,
304 304 config.main.host, config.main.connect_timeout, config.main.timeout, config.main.max_connections);
305 305 pool.acquire(function (err, smtp_client) {
  306 + var auth_capibilities = [];
306 307 connection.logdebug(plugin, 'Got smtp_client: ' + smtp_client.uuid);
307 308 smtp_client.call_next = function (retval, msg) {
308 309 if (this.next) {
@@ -356,7 +357,7 @@ exports.get_client_plugin = function (plugin, connection, config, callback) {
356 357 if (auth_matches = smtp_client.response[line].match(/^AUTH (.*)$/)) {
357 358 auth_matches = auth_matches[1].split(' ');
358 359 for (var i = 0; i < auth_matches.length; i++) {
359   - connection.auth_capibilities.push(auth_matches[i].toLowerCase());
  360 + auth_capibilities.push(auth_matches[i].toLowerCase());
360 361 }
361 362 }
362 363 }
@@ -366,8 +367,8 @@ exports.get_client_plugin = function (plugin, connection, config, callback) {
366 367 if (config.auth && !smtp_client.authentiated) {
367 368 if (config.auth.type === null || typeof(config.auth.type) === 'undefined') { return; } // Ignore blank
368 369 var auth_type = config.auth.type.toLowerCase();
369   - if (connection.auth_capibilities.indexOf(auth_type) == -1) {
370   - throw new Error("Auth type \"" + auth_type + "\" not supported by server (supports: " + connection.auth_capibilities.join(',') + ")")
  370 + if (auth_capibilities.indexOf(auth_type) == -1) {
  371 + throw new Error("Auth type \"" + auth_type + "\" not supported by server (supports: " + auth_capibilities.join(',') + ")")
371 372 }
372 373 switch (auth_type) {
373 374 case 'plain':
@@ -391,8 +392,8 @@ exports.get_client_plugin = function (plugin, connection, config, callback) {
391 392 if (config.auth && !smtp_client.authentiated) {
392 393 if (config.auth.type === null || typeof(config.auth.type) === 'undefined') { return; } // Ignore blank
393 394 var auth_type = config.auth.type.toLowerCase();
394   - if (connection.auth_capibilities.indexOf(auth_type) == -1) {
395   - throw new Error("Auth type \"" + auth_type + "\" not supported by server (supports: " + connection.auth_capibilities.join(',') + ")")
  395 + if (auth_capibilities.indexOf(auth_type) == -1) {
  396 + throw new Error("Auth type \"" + auth_type + "\" not supported by server (supports: " + auth_capibilities.join(',') + ")")
396 397 }
397 398 switch (auth_type) {
398 399 case 'plain':

0 comments on commit 81ec865

Please sign in to comment.
Something went wrong with that request. Please try again.