diff --git a/changelogs/fragments/mail-fix-regression.yaml b/changelogs/fragments/mail-fix-regression.yaml new file mode 100644 index 00000000000..e5a6ed7bb76 --- /dev/null +++ b/changelogs/fragments/mail-fix-regression.yaml @@ -0,0 +1,2 @@ +bugfixes: +- mail - Fix regression when sending mail without TLS/SSL diff --git a/lib/ansible/modules/notification/mail.py b/lib/ansible/modules/notification/mail.py index e1713e90d9e..c5fe5867275 100644 --- a/lib/ansible/modules/notification/mail.py +++ b/lib/ansible/modules/notification/mail.py @@ -255,6 +255,8 @@ def main(): if secure == 'always': module.fail_json(rc=1, msg='Unable to start an encrypted session to %s:%s: %s' % (host, port, to_native(e)), exception=traceback.format_exc()) + except: + pass if not secure_state: smtp = smtplib.SMTP(timeout=timeout)