diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-04-30 00:20:23 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-05-10 18:22:48 +0800 |
commit | e69697300a5e238433faf2e3d1f6e54645a5a1bc (patch) | |
tree | 232ac63593081f44c56475a8887119a1b72579a4 /services/docker/mail-server/aws-sendmail/mail.ts | |
parent | c1b189e0344be1b472e4863984a2c3a1faba0865 (diff) | |
download | crupest-e69697300a5e238433faf2e3d1f6e54645a5a1bc.tar.gz crupest-e69697300a5e238433faf2e3d1f6e54645a5a1bc.tar.bz2 crupest-e69697300a5e238433faf2e3d1f6e54645a5a1bc.zip |
HALF WORK!: 2025-5-10
Diffstat (limited to 'services/docker/mail-server/aws-sendmail/mail.ts')
-rw-r--r-- | services/docker/mail-server/aws-sendmail/mail.ts | 14 |
1 files changed, 10 insertions, 4 deletions
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][]) { |