I just set up my first ever email server and I’m proud of myself! 😊 Do you have any advice to avoid common problems? I mean something beginners often do that they shouldn’t. Thanks!

  • cyberpunk007@lemmy.world
    link
    fedilink
    English
    arrow-up
    24
    arrow-down
    2
    ·
    1 year ago

    You’re in for a world of hurt. Email security is a pain in the ass. I used to do this full time and I’m so glad I don’t have to anymore.

    Not trying to discourage you, it’s fun, it’s cool, but it can be a real PITA.

    • Anafroj@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      1 year ago

      That’s true, but only initially. Once you get SPF/DKIM right, that you domain name grows a few years old (enough to be considered established) and that you nailed your configuration, there is no issue anymore. I’ve been running my own Postfix on a Pi in my home for about 5 years, and It Just Works ™. The only maintenance I do is updating the software (done when updating the rest of the OS), and I don’t get shadowbanned mails anymore, even when sending to outlook.com (which is. by far, the worst peer when self-hosting emails).

      EDIT : by the way, fun fact : it seems not as related to IP reputation as it’s often said (well, unless the IP has bad reputation, of course). I changed my ISP late last year (thus changed my IP), I was very afraid I would lose my good reputation and have to start over with getting my mails shadowbanned, and… nothing happened. My mails just got delivered as usual. So I bet the domain name is at least as important as the IP.

    • z3bra@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      7
      ·
      1 year ago

      Not trying to discourage you

      Well, that’s exactly what it sounds like :/

      Don’t listen to him OP, running your own email server is not “a world of hurt”.

      The initial configuration involves quite a few things (DNS records, DKIM, spam filters, …) But it’s definitely manageable. And when all this is setup, you don’t have to touch it anymore, it just works!

      I’ve been doing it for years now, and I’m not going back ! Congratulations on doing it, and good luck on keeping it running!

    • ninjan@lemmy.mildgrim.com
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      1
      ·
      1 year ago

      Cool, a bit basic but a good start. Getting 10/10 on that should be considered the baseline for having a working email solution for personal use. It verifies DMARC but ignores DNSSEC and DANE which are newer improvements to help prevent spoofing.

      This test is pretty hardcore and full disclosure I don’t pass it myself fully yet, and I’ve spent considerable time learning and testing so it’s not a small task.

      https://internet.nl/

      • majestictechie@lemmy.fosshost.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Mail-tester is just for outbound deliverability, nothing else. DNSSEC is really just for security practices. That doesn’t really effect outbound deliverability though which is always a bigger concern for me.

        • ninjan@lemmy.mildgrim.com
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 year ago

          I don’t really agree. DANE, which builds on DNSSEC, will most likely be used to deny email outright or at least spam mark it in the near future. It provides much needed trust and security to a tool that in many ways is less secure than sending a physical letter. All it really needs is critical mass such that people are forced to implement it or risk their business critical email not reaching its recipient.

          • majestictechie@lemmy.fosshost.com
            link
            fedilink
            English
            arrow-up
            3
            ·
            1 year ago

            I’ve never seen a message denied for DNSSEC. It may be a thing they do in the future, I do think all domains should use it but it’s not something that’ll deny a message.

  • z3bra@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    10
    ·
    1 year ago

    Congratulations! A mail server is quite demanding in terms of initial setup, but it’s also very rewarding !

    Here are a few pointers I can give you:

    • Using a good domain is important, some provider block entire TLDs for cheap domains (eg. .tk or .pw). I learnt it the hard way…
    • Set your MX records to A records, not CNAME
    • Ensure your PTR records match your A records for the mail server
    • Learn about SPF and DKIM
    • Set them up, and verify with mxtoolbox
    • Use the ip:<ipv4> selector for SPF
    • Setup a spamfilter (I like spamassassin)
    • Leave it all running for a few weeks/months
    • Publish a DMARC policy on your DNS, and verify with mxtoolbox

    This should limit a lot your likeliness to end up in spam folders (which is usually the hardest part about running your mail server)

  • wwwwhatever@lemmy.omat.nl
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 year ago

    Make sure you are not an open relay.

    If you also sent mail, make sure you have setup dkim and spf and dmarc

  • Giddy@aussie.zone
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Well done! I tried again last week (3rd try) and gave up when I realised I would need a static ip to get myself off spam blocklists

    • stown@sedd.it
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      You’re better off using a hosting service where they allow you to change your PTR records. A static IP is the very beginning of your problems, you will likely be unable to send traffic on port 25 because residential ISPs block it.

      If you really want control of your email server on your own network you can set up an SMTP relay using a hosting service and configure your local mail server to use it.

      Here’s something to get your started: https://community.mailcow.email/d/1275-the-ultimate-guide-to-run-your-own-smtp-relay-server

      • Giddy@aussie.zone
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Nah I’m out bro. Hosting plenty of stuff already and email is pretty critical