90
submitted 1 year ago* (last edited 1 year ago) by mypasswordis1234@lemmy.world to c/selfhosted@lemmy.world

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!

you are viewing a single comment's thread
view the rest of the comments
[-] wgs@lemmy.sdf.org 25 points 1 year ago* (last edited 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 ip4:<ipv4> and/or ip6:<ipv6> selectors 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)

[-] emhl@feddit.de 1 points 1 year ago

What's the reason for using IPs instead of domain names for SPF and MX?

[-] wgs@lemmy.sdf.org 1 points 1 year ago

Because it's the simplest form of mechanism for SPF, and the most understandable in my opinion.

a and mx mechanisms are just ip4/ip6 with extra resolving steps and more complex rules. For a selfhosted setup where you only have a single IP address, this is the most straightforward

As an example, try to guess which one of these SPF records will or will not pass SPF, given that the IP address sending emails is 1.2.3.1:

$ORIGIN domain.tld.
$TTL 1d

@        SOA      pluto.domain.tld. admin.domain.tld ([…])
          NS      pluto.domain.tld.
          NS      saturn.domain.tld.
          MX 10   mx.domain.tld.
           A      1.2.3.5
         TXT      "v=spf1 a -all"
         TXT      "v=spf1 mx -all"
         TXT      "v=spf1 ip4:1.2.3.1 -all"

jupiter    A      1.2.3.1
pluto      A      1.2.3.2
saturn     A      1.2.3.3
venus      A      1.2.3.4

mx     CNAME      jupiter.domain.tld.
this post was submitted on 31 Jul 2023
90 points (97.9% liked)

Selfhosted

40219 readers
312 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS