I used the Ansible playbook instructions and got my instance up and running, which is where I’m sending this from now. Still, I was not able to get the SMTP side of things working. Does this whole setup self-host SMTP on the Lemmy instance, or is it something I’ll have to sort out externally? I’ve heard some people have had issues with Digital Ocean on certain ports, which is the VPS provider I’m hosting on, but even other ports I’ve tried have not worked.

  • baltakatei
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Theoretically, I don’t think an MX record is absolutely needed to send, but it definitely is needed to receive. An MX record helps an email sending server to figure out which IP address to actually send email data packets towards based on the domain name in the email address (i.e. the @apple.com in steve@apple.com).

    Even if you’re self-hosting your own email server and are using the same domain name for all services and are using port number to differentiate incoming traffic, incoming email won’t come in unless an MX record can explicitly tell other email servers where to send emails labeled with your domain name. An MX record can also be a handy way to redirect email traffic to a different IP address in case the one your server uses is blacklisted by other email servers (e.g. if spammers have used your IP address in the past).

    An A record can associate an IP address with a domain name but an MX record is needed to tell a sending server that a domain name is prepared to accept email at all.

    That said, if you examine the DNS setup instructions that a transactional email company will send you, you’ll see that they also want you to create other DNS records for purposes. For example, Mailgun has me store a public key in a TXT record (making it a DKIM record) used to cryptographically authenticate emails against emails sent by your server (that are forwarded and signed by Mailgun’s private key) to prevent email address impersonation, which might be important even if you’re only sending password reset emails and not expecting to receive email. (I recall receiving several emails from emperorpalpatine@senate.gov while in college, probably sent by mischievous CS students learning about email stuff themselves and realizing our school’s email setup was old and crusty) Mailgun also has me keep a CNAME record as well for some kind of delivery confirmation service (a transactional email service is basically a trusted man-in-the-middle); I forget the details. But, basically, thanks to spammers, there’s more to setting up your own email service than creating an MX record, even if all you’re doing is setting up a Lemmy instance that only needs to send password reset emails.

    Source: someone who has bumbled through Discourse and Mediawiki email setup for small projects.