mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Add option to specify mail providers which are not supported
This commit is contained in:
@@ -19,6 +19,7 @@ import * as Email from 'email-templates'
|
||||
import { join } from 'path'
|
||||
|
||||
const mailimprint = process.env.MAIL_IMPRINT || 'not defined'
|
||||
const mailServerBlacklist = (process.env.MAIL_SERVER_BLACKLIST || '').split(',').filter((item) => !!item)
|
||||
|
||||
const email = new Email({
|
||||
message: {
|
||||
@@ -81,3 +82,10 @@ export const sendUninstallWarningMail = async ({ receiver, deviceName }: {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function isMailServerBlacklisted(mail: string) {
|
||||
const parts = mail.split('@')
|
||||
const domain = parts[parts.length - 1]
|
||||
|
||||
return mailServerBlacklist.indexOf(domain.toLowerCase()) !== -1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user