Add an email logger and an email debug confjson5 param.

This commit is contained in:
zkldi
2021-11-03 00:48:13 +00:00
parent aac1675f77
commit e86cf2dbf2
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -12,9 +12,14 @@ if (ServerConfig.EMAIL_CONFIG) {
try {
transporter = nodemailer.createTransport({
// @ts-expect-error There's a bug in nodemailers types
// where it thinks that sendmail cannot be true while
// debug or logging are enabled.
sendmail: true,
newline: "unix",
path: conf.SENDMAIL_BIN ?? "/usr/bin/sendmail",
debug: !!ServerConfig.EMAIL_CONFIG?.DEBUG,
logger: CreateLogCtx("email-server"),
});
transporter.verify((err) => {
+2
View File
@@ -71,6 +71,7 @@ export interface TachiConfig {
FROM: string;
SENDMAIL_BIN?: string;
DKIM?: SendMailOptions["dkim"];
DEBUG?: boolean;
};
USC_QUEUE_SIZE: integer;
BEATORAJA_QUEUE_SIZE: integer;
@@ -116,6 +117,7 @@ const err = p(config, {
FROM: "string",
SENDMAIL_BIN: "*string",
DKIM: "*object",
DEBUG: "*boolean",
}),
USC_QUEUE_SIZE: p.optional(p.gteInt(2)),
BEATORAJA_QUEUE_SIZE: p.optional(p.gteInt(2)),