SMTP connection refused
Closed this issue · 2 comments
Description of problem
I have a problem with the following Setup
- Kiwi TCMS in a docker container
- SMTP in Network with no Authentication (TLS, SSL Disabled, No Username, Password), MS Exchange
parts of docker-compose.yml
web:
container_name: kiwi_web
depends_on:
- db
restart: always
image: kiwitcms/kiwi:latest
ports:
- 80:8080
- 443:8443
volumes:
- uploads:/Kiwi/uploads:Z
- ssl:/Kiwi/ssl
environment:
...
EMAIL_HOST: "smtp.<domain>.de"
EMAIL_PORT: 25
EMAIL_SUBJECT_PREFIX: "[Kiwi-TCMS] "
SERVER_EMAIL: "kiwi@<domain>.de"
EMAIL_USE_TLS: "false"
EMAIL_USE_SSL: "false"
cap_drop:
- ALL
I always get "Connection refused"
Version or commit hash (if applicable)
13.4
Steps to Reproduce
- docker exec -it kiwi_web /Kiwi/manage.py sendtestemail
Actual results
Traceback (most recent call last):
File "/Kiwi/manage.py", line 12, in
execute_from_command_line(sys.argv)
File "/venv/lib64/python3.11/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/venv/lib64/python3.11/site-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/venv/lib64/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/venv/lib64/python3.11/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib64/python3.11/site-packages/django/core/management/commands/sendtestemail.py", line 35, in handle
send_mail(
File "/venv/lib64/python3.11/site-packages/django/core/mail/init.py", line 87, in send_mail
return mail.send()
^^^^^^^^^^^
File "/venv/lib64/python3.11/site-packages/django/core/mail/message.py", line 299, in send
return self.get_connection(fail_silently).send_messages([self])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib64/python3.11/site-packages/django/core/mail/backends/smtp.py", line 127, in send_messages
new_conn_created = self.open()
^^^^^^^^^^^
File "/venv/lib64/python3.11/site-packages/django/core/mail/backends/smtp.py", line 85, in open
self.connection = self.connection_class(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/smtplib.py", line 255, in init
(code, msg) = self.connect(host, port)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/smtplib.py", line 341, in connect
self.sock = self._get_socket(host, port, self.timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/smtplib.py", line 312, in _get_socket
return socket.create_connection((host, port), timeout,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/socket.py", line 851, in create_connection
raise exceptions[0]
File "/usr/lib64/python3.11/socket.py", line 836, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
Expected results
Send email successfully
Your configuration is wrong, see the documentation at https://kiwitcms.readthedocs.io/en/latest/installing_docker.html#customization
@atodorov Thank you for this hint. I didnt see that its that circumstantial to configure simple variables. Thank you. It works now