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

Remove all requests that cause exceptions from db

This solves #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
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -231,13 +231,11 @@ class Sendmail(object):
                )

        except smtp.SMTPClientError as e:
            if e.code == 501: # Bad recipient address syntax
            yield self.conn.remove_request(
                id=id, service="email", date=date
            )
            log.error(
                strings.redact_emails("Error sending email:{}.".format(e))
                )
            log.error(strings.redact_emails(
                "Error sending email to {}:{}.".format(id, e)))

        except Exception as e:
            log.error(