Skip to content

Commit 9c2b07a

Browse files
committed
fixed: exim mail servers (updated ESMTP)
1 parent d581ffc commit 9c2b07a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

mail.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ var fs = require('fs');
1313
var path = require('path');
1414
var CRLF = '\r\n';
1515
var UNDEFINED = 'undefined';
16+
var REG_ESMTP = /\besmtp\b/i;
1617

1718
var errors = {
1819
notvalid: 'E-mail address is not valid',
@@ -555,7 +556,9 @@ Message.prototype._send = function(socket, options, autosend) {
555556
return;
556557
}
557558

558-
command = isTLS || /\besmtp\b/i.test(line) ? 'EHLO' : 'HELO';
559+
//command = isTLS || /\besmtp\b/i.test(line) ? 'EHLO' : 'HELO';
560+
// @CHANGED: only ESMTP supports auth, so this fix has fixed EXIM mail servers
561+
command = isTLS || (options.user && options.password) || REG_ESMTP.test(line) ? 'EHLO' : 'HELO';
559562
write(command + ' ' + host);
560563
break;
561564

0 commit comments

Comments
 (0)