mirror of
https://github.com/graphql-hive/console
synced 2026-05-23 17:18:23 +00:00
Added posibility to use mail smtp server without trusted certificate (#707)
Co-authored-by: ifilonenko <ivan.filonenko@diabolocom.com> Co-authored-by: Kamil Kisiela <kamil.kisiela@gmail.com>
This commit is contained in:
parent
ce25bfab53
commit
c45894d1dc
2 changed files with 7 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ const SMTPEmailModel = zod.object({
|
|||
EMAIL_PROVIDER_SMTP_PORT: NumberFromString,
|
||||
EMAIL_PROVIDER_SMTP_AUTH_USERNAME: zod.string(),
|
||||
EMAIL_PROVIDER_SMTP_AUTH_PASSWORD: zod.string(),
|
||||
EMAIL_PROVIDER_SMTP_REJECT_UNAUTHORIZED: zod.boolean().optional()
|
||||
});
|
||||
|
||||
const SendmailEmailModel = zod.object({
|
||||
|
|
@ -154,6 +155,9 @@ const emailProviderConfig =
|
|||
user: email.EMAIL_PROVIDER_SMTP_AUTH_USERNAME,
|
||||
pass: email.EMAIL_PROVIDER_SMTP_AUTH_PASSWORD,
|
||||
},
|
||||
tls: {
|
||||
rejectUnauthorized: email.EMAIL_PROVIDER_SMTP_REJECT_UNAUTHORIZED
|
||||
}
|
||||
} as const)
|
||||
: email.EMAIL_PROVIDER === 'sendmail'
|
||||
? ({ provider: 'sendmail' } as const)
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ function smtp(config: SMTPEmailProviderConfig, emailFrom: string) {
|
|||
user: config.auth.user,
|
||||
pass: config.auth.pass,
|
||||
},
|
||||
tls: {
|
||||
rejectUnauthorized: config.tls.rejectUnauthorized
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in a new issue