slimta / python-slimta

Python libraries to send, receive, and queue email.
https://slimta.org/
MIT License
171 stars 43 forks source link

Slimta won't authenticate when using Thunderbird email client #168

Closed Dave-0-0 closed 3 years ago

Dave-0-0 commented 3 years ago

Hello,

I have successfully built Slimta on an Ubuntu 18.04 virtual machine running in Microsoft Azure. I am now trying to configure Thunderbird on a local virtual machine to work with Slimta. Despite providing the correct credentials, Slimta refuses to authenticate.

slimta1

I have verified that the credentials I am using match the credentials for "Dictionary of acceptable outbound credentials." contained in the site_data.py file.

I know Thunderbird is able to talk to my server, because when I click on "re-test", it will respond with "The following settings were found by probing the given server." It will then switch some of the settings on the configuration page. I also see debug messages in the terminal running Slimta.

Additionally, this error appears in the terminal.

ERROR:slimta.util.ptrlookup:exception:OSError:unhandled args=(97, 'Address family not supported by protocol') message='[Errno 97] Address family not supported by protocol' query='::ffff:xx.xx.xx.xx' traceback='Traceback (most recent call last):\n File "/home/mta_admin/mta/python-slimta/slimta/util/ptrlookup.py", line 99, in run\n hostname, , _ = socket.gethostbyaddr(self.ip)\n File "/home/mta_admin/mta/python-slimta/.venv/local/lib/python3.6/site-packages/gevent-21.1.2-py3.6-linux-x86_64.egg/gevent/_socketcommon.py", line 276, in gethostbyaddr\n return get_hub().resolver.gethostbyaddr(ip_address)\n File "/home/mta_admin/mta/python-slimta/.venv/local/lib/python3.6/site-packages/gevent-21.1.2-py3.6-linux-x86_64.egg/gevent/resolver/thread.py", line 66, in gethostbyaddr\n return self.pool.apply(_socket.gethostbyaddr, args, kwargs)\n File "/home/mta_admin/mta/python-slimta/.venv/local/lib/python3.6/site-packages/gevent-21.1.2-py3.6-linux-x86_64.egg/gevent/pool.py", line 161, in apply\n return self.spawn(func, *args, *kwds).get()\n File "src/gevent/event.py", line 329, in gevent._gevent_cevent.AsyncResult.get\n File "src/gevent/event.py", line 359, in gevent._gevent_cevent.AsyncResult.get\n File "src/gevent/event.py", line 347, in gevent._gevent_cevent.AsyncResult.get\n File "src/gevent/event.py", line 327, in gevent._gevent_cevent.AsyncResult._raise_exception\n File "/home/mta_admin/mta/python-slimta/.venv/local/lib/python3.6/site-packages/gevent-21.1.2-py3.6-linux-x86_64.egg/gevent/_compat.py", line 65, in reraise\n raise value.with_traceback(tb)\n File "/home/mta_admin/mta/python-slimta/.venv/local/lib/python3.6/site-packages/gevent-21.1.2-py3.6-linux-x86_64.egg/gevent/threadpool.py", line 167, in __run_task\n thread_result.set(func(args, **kwargs))\nOSError: [Errno 97] Address family not supported by protocol\n'

Please advise on how to resolve this.

Thanks

cneberg commented 3 years ago

are one or both of your hosts ipv6? I wonder if its not supported.

icgood commented 3 years ago

@Dave-0-0 Hi Dave, I think I see a few issues with your configuration screenshot.

For "Incoming", I see you have port 1025. It is a bit confusing, but Thunderbird uses the term "Incoming" to describe how mail is accessed, usually by POP or IMAP. This is not a capability of python-slimta, which only serves SMTP. Port 1025 in the example (or the standard port 25 for production) is used for receiving MX delivered mail from other mail servers. Once received on port 25, mail is generally "delivered" in a way that it is accessible by POP/IMAP. The Terminology page may help shed more light.

Under "Outgoing", I see you have STARTTLS selected. Following the Running the Example instructions you will be able to use STARTTLS, however the example uses and self-signed certificate. Mail applications like Thunderbird rarely allow secure connections using self-signed certificates. Perhaps disabling STARTTLS will work?

The error log you provided is not your issue. The slimta.util.ptrlookup module is a best-effort attempt at finding the PTR record associated with the connecting IP address. If that lookup fails (as it did in your case) it will not have any effect on the connection. The log you are seeing should really be WARN level, instead of ERROR.

The python-slimta library is very low-level, intended for power-users or as a building block for a larger application. You may find the slimta or slimta-docker repositories more useful and user-friendly.