I am working to add custom SMTP to my Supabase project so that emails are routed through Mailgun instead. I've started a discussion over here on the Supabase repo, however it hasn't gained any traction yet.
When attempting to register a user, which would trigger an email, I am instead receiving an error on the request.
{"code":500,"msg":"Error sending confirmation mail","error_id":"bb29c6f4-4d99-4c85-8772-5f2fb042221c"}
When I check the Supabase logs, I see this error:
time="2022-06-26T22:10:34Z" level=error msg="500: Error sending confirmation mail" component=api error="Error sending confirmation email: dial tcp 34.83.33.178:25: i/o timeout" method=POST path=/signup referer="https://www.customdomain.io/" remote_addr="24.19.220.31:22601" request_id=bb29c6f4-4d99-4c85-8772-5f2fb042221c
My Supabase settings are as follows:
SMTP admin email: postmaster@customdomain.io
SMTP host: smtp.mailgun.org
SMTP port: 25
SMTP user: support@customdomain.io
SMTP password: ***************
SMTP sender name: Support
According to the Mailgun domain settings, we can use "ports 25, 587, and 465 (SSL/TLS). I have tried all three, however when I change it to port 465, I instead receive this error:
time="2022-06-28T17:41:59Z" level=error msg="500: Error sending confirmation mail" component=api error="Error sending confirmation email: 535 Authentication failed" method=POST path=/signup referer="https://www.customdomain.io/" remote_addr="24.19.220.31:22611" request_id=6458ccfd-e335-4e5e-916c-c543828c021d
What might cause this timeout? Am I inserting incorrect SMTP credentials to the Supabase settings?
Thanks to @Mansueli in the replies of the OP, I figured it out.
I switched to port 587 as recommended in the docs, and then realized I had the "SMTP admin email" and "SMTP user" fields switched up. Changing those things fixed everything.