Felipe AmaralOriginal post
Rank 2: Process
My Appwrite is not sending emails. The following tests were performed to validate the environment variables:
Log:
appwrite-worker-mails | [Worker] Worker 0 is ready!
appwrite-worker-mails | Worker mails started
appwrite-worker-mails | [Job] Received Job (6807cd8c4a0ba8.90969113).
appwrite-worker-mails | [Job] (6807cd8c4a0ba8.90969113) failed to run.
appwrite-worker-mails | [Job] (6807cd8c4a0ba8.90969113) Error sending mail: SMTP Error: Could not connect to SMTP host.
appwrite-worker-mails | Using deprecated logging configuration. Please update your configuration to use DSN format.Unable to parse DSN: scheme is required
appwrite-worker-mails | [Error] Type: Exception
appwrite-worker-mails | [Error] Message: Error sending mail: SMTP Error: Could not connect to SMTP host.
appwrite-worker-mails | [Error] File: /usr/src/code/src/Appwrite/Platform/Workers/Mails.php
appwrite-worker-mails | [Error] Line: 145
Variables:
docker compose exec appwrite-worker-mails vars | grep SMTP
- _APP_SMTP_HOST=mail.***
- _APP_SMTP_PORT=465
- _APP_SMTP_SECURE=tls
- _APP_SMTP_USERNAME=infra@***
- _APP_SMTP_PASSWORD=***
openssl test:
docker compose exec appwrite-worker-mails sh -c "openssl s_client -connect \$_APP_SMTP_HOST:\$_APP_SMTP_PORT"
Connecting to 192.*.*.*
CONNECTED(00000003)
depth=2 C=US, O=Internet Security Research Group, CN=ISRG Root X1
verify return:1
depth=1 C=US, O=Let's Encrypt, CN=R11
verify return:1
depth=0 CN=mail.***
verify return:1
...
220-*** ESMTP Exim 4.98.1 #2 Tue, 22 Apr 2025 15:05:35 -0300
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
Summary
Developers are facing an SMTP Error when trying to connect to the SMTP host. They discovered that changing the tls to 1.2 in the openssl command resolved the issue. However, their Appwrite is still not sending emails. The log shows an error "SMTP Error: Could not connect to SMTP host." The environment variables and openssl test seem to be correctly configured.
Solution:
Update the tls configuration in the provided shell script to tls1_2 instead of tls1.