]> Untitled Git - lemmy.git/commitdiff
Update message_id to comply with RFC 2822 (#2668)
authorKradyz <81911574+Kradyz@users.noreply.github.com>
Mon, 30 Jan 2023 16:10:51 +0000 (17:10 +0100)
committerGitHub <noreply@github.com>
Mon, 30 Jan 2023 16:10:51 +0000 (11:10 -0500)
The RFC 2822 format standard requires the message ID to be enclosed within angle brackets. If the standard is not followed, SpamAssassin deducts points from the e-mail.

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
crates/utils/src/email.rs

index b7aca726ff0639fe52d13d5fc511a6fdd43161d6..474fc38cab3bdd8726bc34aa4d384a745acc4a50 100644 (file)
@@ -58,7 +58,7 @@ pub fn send_email(
       Some(to_username.to_string()),
       Address::from_str(to_email).expect("email to address isn't valid"),
     ))
-    .message_id(Some(format!("{}@{}", Uuid::new_v4(), settings.hostname)))
+    .message_id(Some(format!("<{}@{}>", Uuid::new_v4(), settings.hostname)))
     .subject(subject)
     .multipart(MultiPart::alternative_plain_html(
       plain_text,