diff options
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][]) { |