Skip to content

Commit 2829405

Browse files
committed
Replace OR for AND in mail (totaljs#522).
1 parent 0e135c1 commit 2829405

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

changes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
- updated: `controller.viewCompile(body, model, [headers], [partial], [cacheKey])` add a cache key
1111
- updated: `image.command(arg, value, [priority], [escape])` a `priority` argument can be `escape` when it contains `boolean` value
1212

13+
- fixed: mail auth when `options.user` and `options.password` are blank
14+
1315
======= 2.7.0
1416

1517
- added: __IMPORTANT__ new unit-testing mechanism

mail.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,8 @@ Mailer.prototype.$send = function(obj, options, autosend) {
675675
var code = +line.match(REG_STATE)[0];
676676

677677
if (code === 250 && !isAuthorization) {
678-
if ((line.indexOf('AUTH LOGIN PLAIN') !== -1 || line.indexOf('AUTH PLAIN LOGIN') !== -1) || (options.user && options.password)) {
678+
// OR was replaced to AND --> https://github.com/totaljs/framework/issues/522
679+
if ((line.indexOf('AUTH LOGIN PLAIN') !== -1 || line.indexOf('AUTH PLAIN LOGIN') !== -1) && (options.user && options.password)) {
679680
isAuthorization = true;
680681
if (line.indexOf('XOAUTH') === -1) {
681682
auth.push('AUTH LOGIN');
@@ -710,7 +711,7 @@ Mailer.prototype.$send = function(obj, options, autosend) {
710711
case 250: // OPERATION
711712
case 251: // FORWARD
712713
case 235: // VERIFY
713-
case 999: // total.js again
714+
case 999: // Total.js again
714715

715716
obj.messagecallback && obj.messagecallback(null, obj.instance);
716717
obj.messagecallback = null;

0 commit comments

Comments
 (0)