infisical icon indicating copy to clipboard operation
infisical copied to clipboard

Self-hosted instance not sending email

Open drtobbyas opened this issue 2 years ago • 7 comments

Describe the bug

Self-hosted instance on Kubernetes does not send emails.

To Reproduce

Steps to reproduce the behavior:

  1. Set up a self-hosted instance on Kubernetes as described in the documentation
  2. Add your valid SMTP details to the values.yaml file
  3. Go to your ingress domain and attempt to sign-up.
  4. The sign-up email will not be sent to the provided email address.

Expected behavior

The sign-up email should be sent to the email address provided for sign-up

Screenshots

If applicable, add screenshots to help explain your problem.

Platform you are having the issue on:

Tested on kubernetes

Additional context

The token hash appear to be logged in the MongoDB database. This gives an indication that the sign-up token was probably generated but not sent to the user.

drtobbyas avatar Feb 25 '23 16:02 drtobbyas

Hey @drtobbyas!

Which SMTP server are you using? You can check out the docs here for how to configure mailing with your own SMTP server.

We currently have confirmed support for SendGrid, Mailgun, AWS SES, and SocketLabs — Happy to add another SMTP server option if you're using something else.

dangtony98 avatar Feb 25 '23 17:02 dangtony98

I tried zohomail smtp with a custom domain. It didn't work. I also tried troubleshooting with mailtrap.io, but It didn't work either.

drtobbyas avatar Feb 25 '23 17:02 drtobbyas

I see. Would you be okay with using one of the existing supported options: SendGrid, Mailgun, AWS SES, or SocketLabs?

If not, I can have support for Zohomail done for you by tomorrow!

dangtony98 avatar Feb 26 '23 09:02 dangtony98

It would be awesome if it can support any (if possible) SMTP server. Many users use different email services including Cpanel kind of hosting.

drtobbyas avatar Feb 27 '23 16:02 drtobbyas

@drtobbyas The issue is that some SMTP servers come with some additional needed configuration on our end (e.g. incompatible TLS version), so they don't always work out of the box; this is why we typically have to confirm SMTP compatibility for each one and provide instructions.

There's actually a whole separate issue to build out support for all/most SMTP servers here.

I'll add in support for Zohomail in the next few hours for you!

dangtony98 avatar Feb 28 '23 07:02 dangtony98

ok, good. Thanks

drtobbyas avatar Feb 28 '23 08:02 drtobbyas

Hey @drtobbyas!

I've just pushed out a new Docker image with support for Zoho Mail — I've added docs for it here as well.

dangtony98 avatar Feb 28 '23 14:02 dangtony98

I have a custom postfix server and i am unable to send emails. I have tried both with SECURE and without, but i don't see any connection in the mail logs. Is it possible to create users without sending email?

Later edit: I was able to send mails by disabling the postfix SSL.

vtmocanu avatar Mar 08 '23 19:03 vtmocanu

I run a https://maddy.email/ server and I just ran into this issue as well.

If I try to send mail over port 587 with SMTP_SECURE=true:

image

With other configurations of ports and SMTP_SECURE, it seems to connect fine but no email is ever actually sent, the most I see in the mail server logs is the initial authentication:

maddy_1          | submission: 220 -snip-.revolt.wtf ESMTP Service Ready
maddy_1          | -snip-
maddy_1          | submission: AUTH PLAIN -snip-
maddy_1          | submission: 235 2.0.0 Authentication succeeded
maddy_1          | submission: QUIT
maddy_1          | submission: 221 2.0.0 Bye

But beyond that, I never see it talk with the mail server again.

I'm not sure if it's intentional but pressing resend (submitting the sign up page does this too) throws 404:

image image

Edit: I forgot to mention but this is also an issue when I try to configure it to use Gandi Mail.

Edit 2: It's the same issue as before.

image

Likewise, switching SSL off allows it to connect fine BUT no emails actually go out.

insertish avatar Mar 09 '23 18:03 insertish

On my case when using Amazon SES, with SMTP_SECURE to true and SMTP_PORT to 587, it gives an 500 Error, and Sentry reports: image

byjokese avatar Jul 15 '23 15:07 byjokese