Hello,

I want to deploy a simple mail server so that it can be used for users to register themselves or reset passwords, etc.

Is there an easy one to deploy (in docker if possible) ?

  • NX2
    link
    fedilink
    English
    1811 months ago

    I wrote a blog some time ago why selfhosting email sucks

    https://nx2.site/email-selfhosting

    If you just want the email server for only you and your friends, or for internal messages, selfhosting email can be fun, but your main email should probably not be selfhosted.

  • @darklamer@lemmy.dbzer0.com
    link
    fedilink
    English
    911 months ago

    As already mentioned several times, selfhosting a mail server is not recommended unless you’re particularly interested in hosting a mail server, but with that said, you might find this project interesting:

    https://maddy.email/

  • @smokinliver@sopuli.xyz
    link
    fedilink
    English
    811 months ago

    There is Mailcow. But simple is relative I guess cause you still gotta configure a lot around it to not end up on every spamlist out there

  • kamenLady.
    link
    fedilink
    English
    711 months ago

    I once came to the conclusion that there is no easy mail server

  • @shrugal@lemm.ee
    link
    fedilink
    English
    6
    edit-2
    11 months ago

    I agree with everyone here that self-hosting email is never easy, but if you still decide to go down this route then here are two tips that I personally found very helpful, especially when you decide to host it at home:

    The first is to get an SMTP relay server. That’s just another mail server that yours can log into to actually send its mail, just like an email client would. That way you don’t have to worry about your IP’s sending reputation, because everyone will only see the relay’s reputable IP.

    Second is to configure a Backup MX. That’s an additional MX DNS entry with lower priority than the primary, and it points to a special mail server that accepts any mail for you and tries to deliver it to the primary server forever (or something like an entire week). So when your primary server is unreachable other sending servers will deliver mail to the backup, and it delivers the mail to the primary as soon as that’s back online.

    You can get these as separate services, but some DNS providers (like Strato for example) offer both with the base domain package. It makes self-hosting an email server much simpler and more reliable in my experience.

  • @hperrin@lemmy.world
    link
    fedilink
    English
    211 months ago

    This is a can of worms, but you’re probably looking for something like Postfix. Running your own mail server is complicated. You need to set up SPF, DKIM, DMARC, and make sure outbound traffic on port 25 isn’t blocked. You need to check if your IP is on any block lists. You can do that here:

    https://mxtoolbox.com/blacklists.aspx

  • Shimitar
    link
    fedilink
    English
    211 months ago

    I I agree with everybody else saying that the email server should not be self-hosted. But I have a specific exception to this rule, which I was keen to try, but I never did this or take this with a pinch of salt.

    I do self-host on my services, but at the moment I keep myself hosted email on a public server, not on my home server.

    Since I am using a tunnel to access my services from outside, my home server is actually using my public server ip. moving my email self-hosting to my home server would not actually change the front facing IP address of that email server, and no harm would be done to my mail server.

    But is it really worth it? Probably not. Since I would still need some kind of backup email server out on the internet for the rare situations where my home server is cut from the internet due to power outage or ISP being down.

    You want full reliability for your email server. So your home connection without UPS or backup connection isn’t going to cut the cheese fully.

    So, I would suggest you don’t self-host your email on your home server. You can still self-host your email, but on a public server. Be aware, though, that is a difficult task which will require lots of effort and many months to get it done right and accepted everywhere.

    • @pHr34kY@lemmy.world
      link
      fedilink
      English
      411 months ago

      I host my own mail. When it’s down, the mail just gets delivered after I get online again. Almost all mail servers are configured to retry over a period of several days before giving up.

      Once my health insurer sent me mail by post to tell me that my mail server was down. That was kinda funny.

      • Shimitar
        link
        fedilink
        English
        211 months ago

        What if your home network goes down while you are away for a week and you cannot get it back online?

        Not a risk I am willing to take, so a backup server would be required.

        • @pHr34kY@lemmy.world
          link
          fedilink
          English
          111 months ago

          The longest outage I’ve had in a decade is when my primary SSD died a 2 months ago and I had to reinstall using config backups. It was down for around a day.

          I’ve thrown a UPS on it and flown overseas for a week or two. It’s basically just email for me and the kids.

          I’ve had longer outages on hosted services, TBH.

  • @mojoaar@lemmy.world
    link
    fedilink
    English
    1
    edit-2
    11 months ago

    I would not go down the route of doing it myself. Take a look at something like: migadu if it is simple mail hosting you are looking for.

  • @MHanak@lemmy.world
    link
    fedilink
    English
    111 months ago

    I’d advice against it, aside from spam filters, and it being a general PITA, there is a chance your ISP will block any outgoing mail traffic (in my case orange blocks it)

      • @cvf@lemmy.world
        link
        fedilink
        English
        1
        edit-2
        11 months ago

        All you need is a local smtp server that relays to another, “real” smtp server. I have a postfix that is configured to use the Proton smtp servers (before that it was Googles). No issues on Telenet.