From abc0be9c8cc239f93c0c9191e84577efbdabd372 Mon Sep 17 00:00:00 2001 From: Luke Faraone Date: Thu, 30 Jan 2014 12:25:00 -0500 Subject: [PATCH] email-mirror: Catch ValueError returned by decode_email_address This indicates that we didn't get the right sort of email address passed to us. (imported from commit 26881d537296ea3d21ac29ff1b67ab260f838e13) --- zerver/lib/email_mirror.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/lib/email_mirror.py b/zerver/lib/email_mirror.py index 0a38f187e4..9b2954b1af 100644 --- a/zerver/lib/email_mirror.py +++ b/zerver/lib/email_mirror.py @@ -166,7 +166,7 @@ def extract_and_upload_attachments(message): def extract_and_validate(email): try: stream_name, token = decode_email_address(email) - except TypeError: + except (TypeError, ValueError): raise ZulipEmailForwardError("Malformed email recipient " + email) if not valid_stream(stream_name, token):