arn-rawmime 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/rawmimeBuilder.js +10 -6
package/package.json
CHANGED
package/src/rawmimeBuilder.js
CHANGED
|
@@ -491,7 +491,7 @@ class MimeMessage {
|
|
|
491
491
|
data,
|
|
492
492
|
encoding = "quoted-printable",
|
|
493
493
|
autoTextPart = false,
|
|
494
|
-
autoMinify =
|
|
494
|
+
autoMinify = null,
|
|
495
495
|
markdownToHtml = false,
|
|
496
496
|
charset = "UTF-8",
|
|
497
497
|
}) {
|
|
@@ -532,7 +532,8 @@ class MimeMessage {
|
|
|
532
532
|
|
|
533
533
|
let finalHtml = data;
|
|
534
534
|
|
|
535
|
-
|
|
535
|
+
const shouldMinify = autoMinify !== null && autoMinify !== undefined ? autoMinify : (this.boundaryStyle !== "outlook");
|
|
536
|
+
if (shouldMinify) {
|
|
536
537
|
finalHtml = this._minifyHtml(finalHtml);
|
|
537
538
|
}
|
|
538
539
|
|
|
@@ -628,11 +629,14 @@ class MimeMessage {
|
|
|
628
629
|
// Wait for Attachments AND Markdown Processing
|
|
629
630
|
await Promise.all([...this.attachmentPromises, ...this.processingPromises]);
|
|
630
631
|
|
|
631
|
-
if (!this.headers.some((h) => h.name.toLowerCase() === "mime-version"))
|
|
632
|
+
if (!this.headers.some((h) => h.name.toLowerCase() === "mime-version") && !this.removedHeaders.has("mime-version"))
|
|
632
633
|
this.headers.unshift({ name: "MIME-Version", value: "1.0" });
|
|
633
|
-
if (!this.headers.some((h) => h.name.toLowerCase() === "date")
|
|
634
|
-
|
|
635
|
-
if (!this.headers.some((h) => h.name.toLowerCase() === "
|
|
634
|
+
if (!this.headers.some((h) => h.name.toLowerCase() === "date") && !this.removedHeaders.has("date"))
|
|
635
|
+
this.setDate();
|
|
636
|
+
if (!this.headers.some((h) => h.name.toLowerCase() === "message-id") && !this.removedHeaders.has("message-id"))
|
|
637
|
+
this.messageId();
|
|
638
|
+
if (!this.headers.some((h) => h.name.toLowerCase() === "subject") && !this.removedHeaders.has("subject"))
|
|
639
|
+
this.setSubject("");
|
|
636
640
|
|
|
637
641
|
// Sort Body: Text parts must come before HTML parts, keeping stable addition order
|
|
638
642
|
const texts = this.bodyParts.filter((p) => p.contentType === "text/plain");
|