mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-03 06:26:39 +08:00
fix: limit SEND_MAIL domain checks to binding paths (#987)
* fix: scope SEND_MAIL domain gating to binding * test: cover SEND_MAIL domain gating in e2e
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
getJsonSetting, getDomains, getIntValue, getBooleanValue, getJsonObjectValue, getSplitStringListValue
|
||||
} from '../utils';
|
||||
import { GeoData } from '../models'
|
||||
import { handleListQuery, updateAddressUpdatedAt } from '../common'
|
||||
import { handleListQuery, isSendMailBindingEnabled, updateAddressUpdatedAt } from '../common'
|
||||
import { ensureSendMailLimit, increaseSendMailLimitCount } from './send_mail_limit_utils';
|
||||
|
||||
|
||||
@@ -213,6 +213,7 @@ export const sendMail = async (
|
||||
sendByVerifiedAddressList = true;
|
||||
}
|
||||
}
|
||||
const sendMailBindingEnabled = isSendMailBindingEnabled(c, mailDomain);
|
||||
|
||||
// send mail workflow
|
||||
if (sendByVerifiedAddressList) {
|
||||
@@ -225,7 +226,7 @@ export const sendMail = async (
|
||||
else if (smtpConfig) {
|
||||
await sendMailBySmtp(c, address, reqJson, smtpConfig);
|
||||
}
|
||||
else if (c.env.SEND_MAIL) {
|
||||
else if (sendMailBindingEnabled) {
|
||||
await sendMailByBinding(c, address, reqJson);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user