diff options
author | Sadie Powell <sadie@witchery.services> | 2023-06-06 16:48:47 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2023-06-06 16:48:47 +0100 |
commit | 7c7158cf2401bd8531473b47d44aebb0d283c961 (patch) | |
tree | cd9342e501680f3b3a7ecb24187e3e45b8c2c70a /src | |
parent | fbf3b344740f6bd4f9337e485e35e9e8103428bc (diff) |
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).
Diffstat (limited to 'src')
-rw-r--r-- | src/mail.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mail.cpp b/src/mail.cpp index 8cdd28193..4027e44f0 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -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); |