From 1ddfb76c859ebd972138a28ea8d0c4856c139c3d Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Sat, 25 Dec 2021 16:07:30 +0100 Subject: [PATCH] improve SMTP SSL support --- diffido.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/diffido.py b/diffido.py index c17f2b3..0ec4201 100755 --- a/diffido.py +++ b/diffido.py @@ -309,6 +309,10 @@ def send_email(to, subject='diffido', body='', from_=None): args[key] = value try: if use_ssl: + for key in ('ssl_keyfile', 'ssl_certfile', 'ssl_context'): + if key in args: + args[key.replace('ssl_', '')] = args[key] + del args[key] logger.debug('STMP SSL connection with args: %s' % repr(args)) with smtplib.SMTP_SSL(**args) as s: if username: