Hey all I have no idea what I’m doing here trying to set up a Lemmy instance. I’ve made simple servers before but nothing like the setup needed for this especially surrounding email verification.

I’m like 10 tutorials deep and on day 3 of trying to figure out what is going on with Postfix. There are so many words and acronyms being thrown around I don’t even know what I’m looking at anymore let alone knowing what the right questions to ask would be.

Very likely I’m going to nuke my droplet this weekend to make sure I have a fresh start with no half-baked solutions competing with each other. Would someone be willing to set up a time with me this weekend on Discord or something and baby step me through how to get this thing up and running?

  • Ms. ArmoredThirteenOP
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    Do you mean something like Brevo? And if so is there a good guide for how to link that kind of thing up with Lemmy?

    • potato@lolimbeer.com
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 year ago

      If you’re standing something up for yourself, and it doesn’t have to be anything fancy, any email provider that provides SMTP *will work.

      This even includes gmail: https://support.google.com/mail/answer/7126229?hl=en

      But, another thing to remember is that many hosting providers block the default ports by default. Many will open the port with a customer service ticket but others will only do it at a certain “tier” of service.

      You mentioned a droplet so I googled digital ocean and smtp, and this thread popped up: https://www.digitalocean.com/community/questions/sending-email-with-do-app-is-it-possible

      I, personally, use linode as my provider and I had to open a ticket with support in order to unblock the right ports to send email.

      As an aside:

      Standing up an email server itself is a good exercise because it’s an absolute PITA. Mainly due to trust and ensuring all your DNS records are right and stuff.

      Overall, it’s a nifty exercise to understand but I, personally, don’t really feel like it’s worth the pain.

      Edit: forgot to finish a sentence

    • NeonWoofGenesis@kek.henlo.fi
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      I’ve been scratching my head over the postfix-relay as you have, until I realized my ISP(running the server at home) blocks port 25.

      So I got the SMTP provider approach to work, through Brevo. I’ll detail my steps here. I also tried to setup using gmail but I got an authentication error so I quickly gave up on that.

      Sign up to Brevo

      Register at Brevo with your totally legit existing company name, then choose the free plan. This allows 300 free emails sent/day.

      On the dash page, click in the top right -> “SMTP & API”. Here’s your login information for the lemmy.hjson config. Use the SMTP key value as your smtp_password

      Edit your lemmy.hjson

      lemmy.hjson

      email: {
        # Hostname and port of the smtp server
        smtp_server: "smtp-relay.brevo.com:587"
        # Address to send emails from, eg noreply@your-instance.com
        smtp_from_address: "noreply@example.tld"
        smtp_login: "<brevo login email>"
        smtp_password: "<smtp key>"
        # Whether or not smtp connections should use tls. Can be none, tls, or starttls
        tls_type: "starttls"
      }
      

      With this approach you also don’t need postfix-relay in your docker-compose.

      With this setup, you should be able to get the verification/password reset emails to be sent. However the recipient will receive a phishing warning or perhaps the email won’t even get through, because your DKIM signature doesn’t match your domain.

      DKIM signature

      To get a proper DKIM signature, you also need to edit your DNS records.

      From the Brevo dashboard click the topright menu again -> “Senders & IP”.

      Go to “Senders” and edit the “From email” field to your own domain example.tld

      Then go back and go to “Domains” -> “Add a domain”. Add in your example.tld and probably choose “Other” for provider. In the next page you get records to add to your DNS provider. If you don’t know how this works there’s a tutorial linked on that page.

      Click authenticate, and you should now see green checkmarks if done correctly :).

      Keep in mind you won’t receive emails if someone replies to these, since there’s no IMAP setup.

      Do tell if there’s anything wrong with these instructions, I only wrote it from memory.

      • Ms. ArmoredThirteenOP
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        This is exactly the kind of one step at a time tutorial I need thank you! I’ll try this soon and let you know how things turn out on my end

      • Ms. ArmoredThirteenOP
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        I think I have this figured out. I’m going to wait until tomorrow when I have a friend online who can double check for me that everything is good, but your comment and other people telling me to use Gmail I think got me to where I need to be. Granted I had to redo my instance and server entirely because I mangled my first one so bad it wouldn’t even load the page… But I think I’ve got it figured out now. Thank you so much for this explanation and example config file

    • hawkwind@lemmy.management
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      You can use lots of email providers, even gmail, and authenticate with their SMTP server to send messages. Sending unsolicited email directly to another mail server will 100% cause it to become spam. There are 30 years of anti-spam ‘webs-of-trust’ and now validating technologies that, if you don’t setup, will guarantee your emails do not get delivered.

    • poVoq@slrpnk.net
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      Any email provider will do. I think you can even enable it for gmail accounts. You can just put in the connection details in the lemmy.hjson.