Skip to content

Commit a929dfb

Browse files
authored
Attempt to simplify
and add in another way to detect if we should be starting a TLS session.
1 parent 060940c commit a929dfb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sendmail.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ module.exports = function (options) {
160160
let parts;
161161
let cmd;
162162
let upgraded = false;
163+
let hellod = false;
163164

164165
/*
165166
if(mail.user && mail.pass){
@@ -183,7 +184,7 @@ module.exports = function (options) {
183184
case 220:
184185
//* 220 on server ready
185186
//* 220 服务就绪
186-
if(/\bGo ahead\b/i.test(msg) || /\bTLS\b/i.test(msg)){
187+
if(/\bGo ahead\b/i.test(msg) || /\bTLS\b/i.test(msg) || hellod){
187188
sock.removeAllListeners('data');
188189

189190
let original = sock;
@@ -233,6 +234,7 @@ module.exports = function (options) {
233234
cmd = 'HELO'
234235
}
235236
w(cmd + ' ' + srcHost);
237+
hellod = true;
236238
break;
237239
}
238240

0 commit comments

Comments
 (0)