this post was submitted on 13 Oct 2023
7 points (100.0% liked)

Lemmy Administration

64 readers
2 users here now

Anything about running your own Lemmy instance. Including how to install it, maintain and customise it.

Be sure to check out the docs: https://join-lemmy.org/docs/en/administration/administration.html

If you have any problems, describe them here and we will try to help you fixing them.

founded 4 years ago
MODERATORS
 

I’m using the Lemmy ansible installation method. I’ve been trying to add sendgrid to the postfix section of the config.hjson file on my local machine. But where do I add the API key and username? I used port 587 but nothing works. Can anyone help walk me through how to integrate sendgrid into Lemmy-Ansible? Thanks!!

the email section of config.hjson looks like this, did I do this right?

  email: {
    smtp_server: "smtp.sendgrid.net:587"
    smtp_from_address: "noreply@{{ domain }}"
    tls_type: "tls"
  }

I was able to find the server location on my VPS under srv/lemmy/domain, so I can edit the lemmy.hjson file there if need be.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago (1 children)

I went through the Sendgrid docs and your configuration seems to be correct. Just to make sure, your login is literally just "apikey" right? As indicated in the docs.

The rotating arrow means that the email is not sending out.

You can also try starttls (port 587) if tls and none does not work.

[–] ZMonster 2 points 1 year ago (1 children)

try starttls (port 587)

😃 OMG it just worked! Thank you so much!!! You have no idea how excited I am to get my instance up and live! Here is my current lemmy.hjson after a successful ansible install:

  email: {
    smtp_server: "smtp.sendgrid.net:587"
    smtp_login: "apikey"
    smtp_password: "theActualApiKey"
    smtp_from_address: "[email protected]"
    tls_type: "starttls"
  }

For others, I'm using digitalOcean for my VPS and sendgrid for the SMTP relay.

[–] [email protected] 1 points 1 year ago (1 children)

Good to know! Have fun with your new instance!

[–] ZMonster 1 points 1 year ago* (last edited 1 year ago)

So frustrating. I got it working for about 10 minutes. Added users, authenticated them, made posts, uploaded banner, logged in and out many times. Then it just shut down. 502: bad gateway.

I tried to rebuild it fresh and found out that the ansible method has you request a new letsencrypt cert EVERY TIME IT RUNS. And after 5 certs, it bans your domain for 168 hrs...

So now I have to wait until next week to try again, and I'll only have 5 chances at getting it right.

I keep looking at the mastodon documentation and it's so nice. It's complete and thorough. I just wish a Lemmy dev or literally anyone would write a better guide.

I'm just so fucking deflated right now. Thinking of buying a new domain just so I can keep testing.