From 4d637e3587b316522e7545fff209d0fa0bce9ac2 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Wed, 28 Oct 2015 11:42:14 +0000 Subject: [PATCH] Replaced a remaining use of removed function smtp_error_logging(). - Legacy-Id: 10331 --- ietf/bin/send-scheduled-mail | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ietf/bin/send-scheduled-mail b/ietf/bin/send-scheduled-mail index 694a2e33f..8adfd3021 100755 --- a/ietf/bin/send-scheduled-mail +++ b/ietf/bin/send-scheduled-mail @@ -9,7 +9,7 @@ syslog.openlog(os.path.basename(__file__), syslog.LOG_PID, syslog.LOG_USER) import django django.setup() -from ietf.utils.mail import smtp_error_logging +from ietf.utils.mail import log_smtp_exception, send_error_email from smtplib import SMTPException @@ -31,6 +31,9 @@ if mode == "specific": needs_sending = needs_sending.exclude(send_at=None).filter(send_at__lte=now) for s in needs_sending: - with smtp_error_logging(send_scheduled_message_from_send_queue) as send: - send(s) + try: + send_scheduled_message_from_send_queue(s) syslog.syslog(u'Sent scheduled message %s "%s"' % (s.id, s.message.subject)) + except SMTPException as e: + log_smtp_exception(e) + send_error_email(e)