Preserve QOutlook Reply-To in EML

This commit is contained in:
Курнат Андрей
2026-06-01 19:52:15 +03:00
parent 7337dbf5cd
commit 0a75ec7b1a
5 changed files with 28 additions and 5 deletions
+8
View File
@@ -176,6 +176,7 @@ describe("outlookMail helpers", () => {
"To: reader@example.com",
"Cc: copy@example.com",
"Bcc: hidden@example.com",
"Reply-To: support@example.com",
"Subject: =?UTF-8?B?0JzRg9C70YzRgtC40L/QsNGA0YI=?=",
"Date: Mon, 01 Jun 2026 10:00:00 +0300",
'Content-Type: multipart/alternative; boundary="alt"',
@@ -200,6 +201,7 @@ describe("outlookMail helpers", () => {
expect(imported.to).toBe("reader@example.com");
expect(imported.cc).toBe("copy@example.com");
expect(imported.bcc).toBe("hidden@example.com");
expect(imported.replyTo).toBe("support@example.com");
});
it("импортирует multipart/mixed EML с вложением", async () => {
@@ -249,6 +251,7 @@ describe("outlookMail helpers", () => {
{
senderSmtpAddress: "sender@example.com",
subject: "MSG отчет",
headers: "Reply-To: support@example.com\r\nFrom: sender@example.com",
bodyHtml: "<p>HTML&nbsp;текст</p>",
messageDeliveryTime: "Mon, 01 Jun 2026 10:00:00 GMT",
recipients: [
@@ -266,6 +269,7 @@ describe("outlookMail helpers", () => {
to: "reader@example.com",
cc: "copy@example.com",
bcc: "hidden@example.com",
replyTo: "support@example.com",
subject: "MSG отчет",
body: "HTML текст",
time: "Mon, 01 Jun 2026 10:00:00 GMT",
@@ -294,6 +298,7 @@ describe("outlookMail helpers", () => {
to: "reader@example.com",
cc: "copy@example.com",
bcc: "hidden@example.com",
replyTo: "support@example.com",
subject: "Тема",
body: "Текст",
time: "Mon, 01 Jan 2024 10:00:00 +0000",
@@ -306,6 +311,7 @@ describe("outlookMail helpers", () => {
expect(eml).toContain("From: sender@example.com");
expect(eml).toContain("Cc: copy@example.com");
expect(eml).toContain("Bcc: hidden@example.com");
expect(eml).toContain("Reply-To: support@example.com");
expect(eml).toContain("Subject: =?UTF-8?B?");
expect(eml.endsWith("Текст")).toBe(true);
});
@@ -318,6 +324,7 @@ describe("outlookMail helpers", () => {
to: "reader@example.com",
cc: "copy@example.com",
bcc: "hidden@example.com",
replyTo: "support@example.com",
subject: "Тема",
body: "Текст",
time: "Mon, 01 Jan 2024 10:00:00 +0000",
@@ -342,6 +349,7 @@ describe("outlookMail helpers", () => {
expect(eml).toContain("Content-Type: multipart/mixed");
expect(eml).toContain("Cc: copy@example.com");
expect(eml).toContain("Bcc: hidden@example.com");
expect(eml).toContain("Reply-To: support@example.com");
expect(eml).toContain("filename*=utf-8''%D0%BE%D1%82%D1%87%D0%B5%D1%82%2E%74%78%74");
expect(extractMessageBody(parsed.headers, parsed.body)).toBe("Текст");
expect(attachments[0]).toMatchObject({