ipa-epn command displays 'exception: ConnectionRefusedError: [Errno 111] Connection refused'
Steps to Reproduce: 1. Run ipa-epn on IPA server without smtp service running
Actual results: [root@master ~]# ipa-epn --dry-run [] The IPA-EPN command was successful [root@master ~]# ipa-epn --mail-test [Errno 111] Connection refused
2020-08-03T14:58:11Z DEBUG File "/usr/lib/python3.6/site-packages/ipapython/admintool.py", line 179, in execute return_value = self.run() File "/usr/lib/python3.6/site-packages/ipaclient/install/ipa_epn.py", line 290, in run msg_charset=api.env.msg_charset, File "/usr/lib/python3.6/site-packages/ipaclient/install/ipa_epn.py", line 741, in init smtp_password=smtp_password, File "/usr/lib/python3.6/site-packages/ipaclient/install/ipa_epn.py", line 597, in init self._connect() File "/usr/lib/python3.6/site-packages/ipaclient/install/ipa_epn.py", line 629, in _connect timeout=self._smtp_timeout, File "/usr/lib64/python3.6/smtplib.py", line 251, in init (code, msg) = self.connect(host, port) File "/usr/lib64/python3.6/smtplib.py", line 336, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/lib64/python3.6/smtplib.py", line 307, in _get_socket self.source_address) File "/usr/lib64/python3.6/socket.py", line 724, in create_connection raise err File "/usr/lib64/python3.6/socket.py", line 713, in create_connection sock.connect(sa)
2020-08-03T14:58:11Z DEBUG The IPA-EPN command failed, exception: ConnectionRefusedError: [Errno 111] Connection refused 2020-08-03T14:58:11Z ERROR [Errno 111] Connection refused 2020-08-03T14:58:11Z ERROR The IPA-EPN command failed. See /var/log/ipaepn.log for more information
Expected results: Need to fix the traceback seen.
Metadata Update from @fcami: - Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1863079
Metadata Update from @fcami: - Custom field changelog adjusted to EPN now displays a proper message if the configured SMTP server cannot be contacted. - Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/5010
master:
Metadata Update from @rcritten: - Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1863079, https://bugzilla.redhat.com/show_bug.cgi?id=1863079 (was: https://bugzilla.redhat.com/show_bug.cgi?id=1863079)
Issue linked to Bugzilla: Bug 1863079
ipa-4-8:
Metadata Update from @rcritten: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)