diff options
Diffstat (limited to 'deno/mail-relay/dumb-smtp-server.ts')
-rw-r--r-- | deno/mail-relay/dumb-smtp-server.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/deno/mail-relay/dumb-smtp-server.ts b/deno/mail-relay/dumb-smtp-server.ts index 94502c4..818cc88 100644 --- a/deno/mail-relay/dumb-smtp-server.ts +++ b/deno/mail-relay/dumb-smtp-server.ts @@ -47,7 +47,7 @@ export class DumbSmtpServer { const [decoder, encoder] = [new TextDecoder(), new TextEncoder()]; const decode = (data: Uint8Array) => decoder.decode(data); const send = async (s: string) => { - console.info(LOG_TAG, "Send line: " + s); + console.info(LOG_TAG, "Send line:" + s); await writer.write(encoder.encode(s + CRLF)); }; @@ -70,7 +70,7 @@ export class DumbSmtpServer { buffer = buffer.slice(eolPos + CRLF.length); if (rawMail == null) { - console.info(LOG_TAG, "Received line: " + line); + console.info(LOG_TAG, "Received line:" + line); const upperLine = line.toUpperCase(); if (upperLine.startsWith("EHLO") || upperLine.startsWith("HELO")) { await send(this.#responses["EHLO"]); @@ -86,18 +86,17 @@ export class DumbSmtpServer { await send(this.#responses["QUIT"]); return; } else { - console.warn(LOG_TAG, "Unrecognized command from client: " + line); + console.warn(LOG_TAG, "Unrecognized command from client:" + line); await send(this.#responses["INVALID"]); return; } } else { if (line === ".") { try { - console.info(LOG_TAG, "Mail data Received, begin to relay..."); + console.info(LOG_TAG, "Mail data received, begin to relay..."); const { smtpMessage } = await this.#deliverer.deliverRaw(rawMail); await send(`250 2.6.0 ${smtpMessage}`); rawMail = null; - console.info(LOG_TAG, "Relay succeeded."); } catch (err) { console.error(LOG_TAG, "Relay failed.", err); await send("554 5.3.0 Error: check server log"); @@ -124,7 +123,7 @@ export class DumbSmtpServer { try { await this.#handleConnection(conn); } catch (cause) { - console.error(LOG_TAG, "Tcp connection throws an error.", cause); + console.error(LOG_TAG, "Tcp connection throws an error:", cause); } } } |