summary refs log tree commit diff
path: root/synapse/push/emailpusher.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-27 13:46:16 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-27 13:46:16 +0100
commit9773abf3d8e1b2711e936ff150d8ae2f48f98be9 (patch)
treeb8c98e96f1262bba37a7ec58bcc7373fdd99a751 /synapse/push/emailpusher.py
parentMerge remote-tracking branch 'origin/release-v1.32.2' into matrix-org-hotfixes (diff)
parentRemove various bits of compatibility code for Python <3.6 (#9879) (diff)
downloadsynapse-9773abf3d8e1b2711e936ff150d8ae2f48f98be9.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/push/emailpusher.py')
-rw-r--r--synapse/push/emailpusher.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/push/emailpusher.py b/synapse/push/emailpusher.py

index cd89b54305..99a18874d1 100644 --- a/synapse/push/emailpusher.py +++ b/synapse/push/emailpusher.py
@@ -19,8 +19,9 @@ from twisted.internet.error import AlreadyCalled, AlreadyCancelled from twisted.internet.interfaces import IDelayedCall from synapse.metrics.background_process_metrics import run_as_background_process -from synapse.push import Pusher, PusherConfig, ThrottleParams +from synapse.push import Pusher, PusherConfig, PusherConfigException, ThrottleParams from synapse.push.mailer import Mailer +from synapse.util.threepids import validate_email if TYPE_CHECKING: from synapse.server import HomeServer @@ -71,6 +72,12 @@ class EmailPusher(Pusher): self._is_processing = False + # Make sure that the email is valid. + try: + validate_email(self.email) + except ValueError: + raise PusherConfigException("Invalid email") + def on_started(self, should_check_for_notifs: bool) -> None: """Called when this pusher has been started.