1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 21:33:12 +02:00

Terminate lines with CR+LF instead of just LF when sending an email.

From https://www.rfc-editor.org/rfc/rfc5321#section-2.3.1:

> Lines consist of zero or more data characters terminated by the
> sequence ASCII character "CR" (hex value 0D) followed immediately by
> ASCII character "LF" (hex value 0A).
This commit is contained in:
Sadie Powell
2023-06-06 16:48:47 +01:00
parent fbf3b34474
commit 7c7158cf24
+8 -8
View File
@@ -35,17 +35,17 @@ void Mail::Message::Run()
return;
}
fprintf(pipe, "From: %s\n", send_from.c_str());
fprintf(pipe, "From: %s\r\n", send_from.c_str());
if (this->dont_quote_addresses)
fprintf(pipe, "To: %s <%s>\n", mail_to.c_str(), addr.c_str());
fprintf(pipe, "To: %s <%s>\r\n", mail_to.c_str(), addr.c_str());
else
fprintf(pipe, "To: \"%s\" <%s>\n", mail_to.c_str(), addr.c_str());
fprintf(pipe, "Subject: %s\n", subject.c_str());
fprintf(pipe, "Content-Type: text/plain; charset=UTF-8;\n");
fprintf(pipe, "Content-Transfer-Encoding: 8bit\n");
fprintf(pipe, "\n");
fprintf(pipe, "To: \"%s\" <%s>\r\n", mail_to.c_str(), addr.c_str());
fprintf(pipe, "Subject: %s\r\n", subject.c_str());
fprintf(pipe, "Content-Type: text/plain; charset=UTF-8;\r\n");
fprintf(pipe, "Content-Transfer-Encoding: 8bit\r\n");
fprintf(pipe, "\r\n");
fprintf(pipe, "%s", message.c_str());
fprintf(pipe, "\n.\n");
fprintf(pipe, "\r\n.\r\n");
pclose(pipe);