From 1ad1c1c87b637da6f7892cd16a0a0f0b3b4d15e8 Mon Sep 17 00:00:00 2001
From: Peter Kosyh
Date: Sun, 4 Nov 2018 21:45:10 +0300
Subject: [PATCH] mail_daemon: ESMTP auth fix (250 AUTH reply)
See RFC 5231 (https://tools.ietf.org/html/rfc5321): "Following the normal
syntax for multiline replies, these keywords follow the code (250) and a
hyphen for all but the last line..."
Change-Id: I1ee533a332d1e18ffddd4ad1520d14f4013b739e
Reviewed-on: https://review.haiku-os.org/670
Reviewed-by: waddlesplash
---
src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp b/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp
index 81436313cc..43a29548f5 100644
--- a/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp
+++ b/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp
@@ -425,7 +425,8 @@ SMTPProtocol::Open(const char *address, int port, bool esmtp)
if (esmtp) {
const char *res = fLog.String();
char *p;
- if ((p = ::strstr(res, "250-AUTH")) != NULL) {
+ if ((p = ::strstr(res, "250-AUTH")) != NULL
+ || (p = ::strstr(res, "250 AUTH")) != NULL) {
if(::strstr(p, "LOGIN"))
fAuthType |= LOGIN;
if(::strstr(p, "PLAIN"))