My appwrite self-hosted instance on DigitalOcean cannot sennd emails. The following results were performed
Log:
docker compose logs -f appwrite-worker-mails
appwrite-worker-mails | [Worker] Worker 0 is ready!
appwrite-worker-mails | Worker mails started
appwrite-worker-mails | [Job] Received Job (680cb38fa668a7.96149614).
appwrite-worker-mails | [Job] (680cb38fa668a7.96149614) failed to run.
appwrite-worker-mails | [Job] (680cb38fa668a7.96149614) Error sending mail: SMTP Error: Could not connect to SMTP host. Failed to connect to server
appwrite-worker-mails | Error log pushed with status code: 200
appwrite-worker-mails | [Error] Type: Exception
appwrite-worker-mails | [Error] Message: Error sending mail: SMTP Error: Could not connect to SMTP host. Failed to connect to server
appwrite-worker-mails | [Error] File: /usr/src/code/src/Appwrite/Platform/Workers/Mails.php
appwrite-worker-mails | [Error] Line: 145
Environment Variables:
docker compose exec appwrite-worker-mails vars | grep SMTP
- _APP_SMTP_HOST=smtp.sendgrid.net
- _APP_SMTP_PORT=465
- _APP_SMTP_SECURE=tls
- _APP_SMTP_USERNAME=apikey
- _APP_SMTP_PASSWORD=SG.***
OpenSSL test using command with -tls1, -tls1_2
#!/bin/sh
TO=email@mydomain.com
if [ ! -z "$1" ]; then
TO=$1
fi
COMMAND='echo -e "From: <$_APP_SYSTEM_EMAIL_ADDRESS>\nSubject: Test SMTP Connection" | sendmail -H "openssl s_client -quiet -tls1 -connect $_APP_SMTP_HOST:$_APP_SMTP_PORT" -au$_APP_SMTP_USERNAME -ap$_APP_SMTP_PASSWORD -f $_APP_SYSTEM_EMAIL_ADDRESS -v'
COMMAND="${COMMAND} ${TO}"
docker compose exec appwrite-worker-mails sh -c "$COMMAND"
Output:
sendmail: send:'NOOP'
283B591CE6700000:error:8000006E:system library:BIO_connect:Operation timed out:crypto/bio/bio_sock2.c:178:calling connect()
283B591CE6700000:error:10000067:BIO routines:BIO_connect:connect error:crypto/bio/bio_sock2.c:180:
283B591CE6700000:error:8000006E:system library:BIO_connect:Operation timed out:crypto/bio/bio_sock2.c:178:calling connect()
283B591CE6700000:error:10000067:BIO routines:BIO_connect:connect error:crypto/bio/bio_sock2.c:180:
connect:errno=110
sendmail: helper exited (1)
I can send an email Using the Messaging > Providers > Sendgrid
Adding it in Settings > SMPT will result an error
Recommended threads
- 408 Timeout / Curl Error 7 in Executor w...
Hey everyone, I am losing my mind over a routing loop/timeout issue on a fresh self-hosted setup. I have a single Linux VPS (IP: 45.141.37.105) and one domain (...
- functions returning error 401 in local
I updated to 1.9.0, and the functions that used to work fine in 1.8.1 are now giving me a 401 error. I can't seem to find a solution. If anyone is running versi...
- Docker Compose MongoDB Setup
everythings work fine but the mongodb fails on startup everytime. log: ``` Generating random MongoDB keyfile... /bin/bash: line 9: : No such file or directory ...