diff options
Diffstat (limited to 'services/docker/mail-server/aws-sendmail/main.ts')
-rw-r--r-- | services/docker/mail-server/aws-sendmail/main.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/services/docker/mail-server/aws-sendmail/main.ts b/services/docker/mail-server/aws-sendmail/main.ts new file mode 100644 index 0000000..b4f297d --- /dev/null +++ b/services/docker/mail-server/aws-sendmail/main.ts @@ -0,0 +1,25 @@ +function appendHeaders(rawMail: string, headers: [key: string, value: string][]): string { + // Use the last eol in mail. If no eol, use LF. + const eol = rawMail.match(/\r\n|\n/g)?.at(-1) ?? '\n' + const headerStr = headers.map(h => `${h[0]}: ${h[0]}`).join(eol); + + if (rawMail.length === 0) { return headerStr; } + + const endOfHeadersMatch = rawMail.match(/(\r\n|\n){2}/) + if (endOfHeadersMatch == null) { + const endWithEOL = rawMail.endsWith('\n') + return rawMail + } +} + +class AppSate { +} + +export function add(a: number, b: number): number { + return a + b; +} + +// Learn more at https://docs.deno.com/runtime/manual/examples/module_metadata#concepts +if (import.meta.main) { + console.log("Add 2 + 3 =", add(2, 3)); +} |