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)
This commit is contained in:
Luke Faraone
2014-01-30 12:25:00 -05:00
parent 179be2051d
commit abc0be9c8c

View File

@@ -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):