Skip to content

Commit

Permalink
Omit \r\r\n
Browse files Browse the repository at this point in the history
Check if endline is already \r\n
  • Loading branch information
ionum authored Jun 20, 2021
1 parent 073f4e9 commit 1c62711
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions protocols/smtp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 1c62711

Please sign in to comment.