
On 2/27/25 12:36, Kim Sunggun via Mailman-users wrote:
script: #!/usr/bin/env python3 import smtplib
host = 'localhost' port = 25 connection = smtplib.SMTP(host=host, port=port) connection.ehlo() connection.quit()
result: Traceback (most recent call last): File "/opt/mailman/./testone.py", line 7, in <module> connection = smtplib.SMTP(host=host, port=port) File "/usr/lib64/python3.9/smtplib.py", line 255, in __init__ (code, msg) = self.connect(host, port) File "/usr/lib64/python3.9/smtplib.py", line 341, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/lib64/python3.9/smtplib.py", line 312, in _get_socket return socket.create_connection((host, port), timeout, File "/usr/lib64/python3.9/socket.py", line 856, in create_connection raise err File "/usr/lib64/python3.9/socket.py", line 844, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused
So you are doing the same thing Django allauth is doing with the same result. Do you even have an MTA listening on localhost, port 25?
You need to figure out what settings you need to be able to connect to your outgoing MTA and set
EMAIL_HOST EMAIL_PORT
and maybe some of
EMAIL_HOST_USER EMAIL_HOST_PASSWORD EMAIL_USE_TLS EMAIL_USE_SSL EMAIL_SSL_CERTFILE EMAIL_SSL_KEYFILE
appropriately so you can connect to the MTA. If outgoing mail from Mailman works, look in the [mta] section in mailman.cfg for the appropriate settings.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan