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 committed Oct 18, 2023
1 parent 7ed88a0 commit fc1fab9
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 fc1fab9

Please sign in to comment.