From e69697300a5e238433faf2e3d1f6e54645a5a1bc Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Wed, 30 Apr 2025 00:20:23 +0800 Subject: HALF WORK!: 2025-5-10 --- services/docker/mail-server/aws-sendmail/mail.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'services/docker/mail-server/aws-sendmail/mail.ts') diff --git a/services/docker/mail-server/aws-sendmail/mail.ts b/services/docker/mail-server/aws-sendmail/mail.ts index 82902d2..d4bcf75 100644 --- a/services/docker/mail-server/aws-sendmail/mail.ts +++ b/services/docker/mail-server/aws-sendmail/mail.ts @@ -113,11 +113,17 @@ export class Mail { simpleParseHeaders(): [key: string, value: string][] { const { headerStr } = this.simpleParse(); - const rawLines = headerStr.split(/\r\n|\n|\r/); - const headerLines = []; - for (const l of rawLines) { - + const lines: string[] = []; + for (const line of headerStr.split(/\r?\n|\r/)) { + if (line.match(/^\s/)) { + if (lines.length === 0) { + throw new MailParseError("Header part starts with a space.", this); + } + lines[lines.length - 1] += line; + } } + + // TODO: Continue here. } appendHeaders(headers: [key: string, value: string][]) { -- cgit v1.2.3