Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

send_email: Only attempt suppression list removal with credentials.

Alex Vandiver66c123dd437c
diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.py
index d7ccc514659..d1e2a75fe86 100644
--- a/zerver/lib/send_email.py
+++ b/zerver/lib/send_email.py
@@ -778,6 +778,9 @@ def maybe_remove_from_suppression_list(email: str) -> None:
import boto3
import botocore
+ if boto3.session.Session().get_credentials() is None:
+ return
+
with contextlib.suppress(botocore.exceptions.ClientError):
boto3.client("sesv2", region_name=maybe_aws[1]).delete_suppressed_destination(
EmailAddress=email