Commit 80371ae6 authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Remove all requests that cause exceptions from db

This solves gettor#77 where a non-ascii email address was causing our
SMTP client to throw an error. We need to remove the request from the
database in order to move on and process the rest of the requests.
parent ae30ca5e
...@@ -231,13 +231,11 @@ class Sendmail(object): ...@@ -231,13 +231,11 @@ class Sendmail(object):
) )
except smtp.SMTPClientError as e: except smtp.SMTPClientError as e:
if e.code == 501: # Bad recipient address syntax
yield self.conn.remove_request( yield self.conn.remove_request(
id=id, service="email", date=date id=id, service="email", date=date
) )
log.error( log.error(strings.redact_emails(
strings.redact_emails("Error sending email:{}.".format(e)) "Error sending email to {}:{}.".format(id, e)))
except Exception as e: except Exception as e:
log.error( log.error(
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment