From 1c6271127f9d7676bde344ec90964964a0c200db Mon Sep 17 00:00:00 2001 From: ionum Date: Sun, 20 Jun 2021 21:54:40 +0200 Subject: [PATCH] Omit \r\r\n Check if endline is already \r\n --- protocols/smtp.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/protocols/smtp.cc b/protocols/smtp.cc index de6be32..70a624b 100644 --- a/protocols/smtp.cc +++ b/protocols/smtp.cc @@ -194,6 +194,7 @@ void smtp::send_data(fdibuf& msg) docmd("DATA", 300); mystring tmp; while(msg.getline(tmp)) { + if(tmp[tmp.length()-1] == '\r') tmp = tmp.left(tmp.length()-1); if((tmp[0] == '.' && !(out << ".")) || !(out << tmp << "\r\n")) protocol_fail(ERR_MSG_WRITE, "Error sending message to remote");