feat(email): remove rate limit functionality

This commit is contained in:
YuehuCao 2025-08-28 16:23:57 +08:00
parent d7a615b8ea
commit 8a5343156c

View File

@ -58,9 +58,9 @@ class TenantNotificationManager:
raise InvalidDataError("All recipient emails are blacklisted") raise InvalidDataError("All recipient emails are blacklisted")
# 3. check rate limit # 3. check rate limit
rate_limit_result = await self.email_spam_protection_service.check_rate_limit(tenant_id, sender_email) #rate_limit_result = await self.email_spam_protection_service.check_rate_limit(tenant_id, sender_email)
if not rate_limit_result["allowed"]: #if not rate_limit_result["allowed"]:
raise InvalidDataError("Rate limit exceeded") #raise InvalidDataError("Rate limit exceeded")
# 4. spam detection with region # 4. spam detection with region
email_content = { email_content = {
@ -89,7 +89,7 @@ class TenantNotificationManager:
"invalid_recipients": invalid_recipients, "invalid_recipients": invalid_recipients,
"invalid_sender": not valid_sender, "invalid_sender": not valid_sender,
"blacklisted_recipients": blacklisted_recipients, "blacklisted_recipients": blacklisted_recipients,
"rate_limit_info": rate_limit_result, #"rate_limit_info": rate_limit_result,
"spam_detection_info": spam_result "spam_detection_info": spam_result
} }
} }
@ -114,7 +114,7 @@ class TenantNotificationManager:
"invalid_recipients": invalid_recipients, "invalid_recipients": invalid_recipients,
"invalid_sender": not valid_sender, "invalid_sender": not valid_sender,
"blacklisted_recipients": blacklisted_recipients, "blacklisted_recipients": blacklisted_recipients,
"rate_limit_info": rate_limit_result, #"rate_limit_info": rate_limit_result,
"spam_detection_info": spam_result "spam_detection_info": spam_result
} }
} }