소스 검색

melib/attachments: ensure MIME boundary prefixed with CRLF

Sometimes attachment bytes don't end with CRLF, so we must prefix the
boundary line ourselves.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Manos Pitsidianakis 7 달 전
부모
커밋
60c90d75
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      melib/src/email/attachments.rs

+ 3 - 0
melib/src/email/attachments.rs

@@ -813,6 +813,9 @@ impl Attachment {
                         ret.push_str(&boundary_start);
                         into_raw_helper(p, ret);
                     }
+                    if !ret.ends_with("\r\n") {
+                        ret.push_str("\r\n");
+                    }
                     ret.push_str(&format!("--{}--\r\n\r\n", boundary));
                 }
                 ContentType::MessageRfc822 => {