Internal Home Email Server

I am looking to run a home email server and also host internal Bitwarden.

At the moment I am using Yahoo and Google and I intend to keep doing this but I want an internal email system for two reasons:

  1. I have various systems that can send email alerts and I don’t want to send those externally.

  2. I’m currently using POP3 as I want my email local. But this is a pain when using multiple devices.

The goal is to still use Yahoo and Gogle for mail but to fetch the email to the local server where I then use IMAP for my internal systems to read the mail. Outgoing email would still go via Yahoo and Google.

My problem is that I have no idea how to do this. Any suggestions? Can I even do this?

My fileserver is currently TrueNAS core running on an HP N54L microserver. I’m very happy with this and don’t intend to use that for email.

I also have an HP N40L microserver that used to run WHS 2011 and currently does nothing. I’d like to use this for the internal email/Bitwarden server.

So, I’m looking for suggestions on which operating system to use and how to achieve the above.

The N40L has 4GB memory and 5 2TB disks.

Any advice/suggestions?

Been years since I ran a mail server but I know the things I used to use are still relevant such as Postfix. Maybe someone here can offer some mail server suggestions.

First of all, that would be a fairly complex setup, and I’m not entirely sure it would even work without having full control over the receiving email server. Also, in my opinion, it doesn’t make too much sense to handle only the IMAP part locally, at least not for privacy reasons. However, if your goal is to have a local copy / backup of all your emails, it would be easier to use an email archiving solution instead of running your own IMAP server locally.

For the local notification mails, you could look into Postfix for sending and receiving email and Dovecot to provide IMAP mail collection. Both packages are included in the repos of every common Linux distributions. If you only need to send mail internally, you don’t need a domain and all the other stuff that is necessary to send mail reliably nowdays. There may be easier solutions than Postfix / Dovecot for this, but unfortunately, I can’t give you any recommendations, becuse I just use a regular email account on my already existing mail server for this, which brings us to the next option:

You could run your own fully-fledged mail server on a VPS, which is what I’m doing. There are appliances like Mail-in-a-Box or Mailcow, that make the setup process and also the administration of your own mailserver relatively easy. However there is still a learning curve, if you never dealt with email servers before.

And last but not least, if you absolutely want to host all your emails locally, you could go with a slightly modified version of your original plan. In this scenario you would host your own MTA like Postfix externally on a VPS, and the IMAP part locally. In contrast to your original plan, I know for sure that this can be done. But! It’s also, by far, the most complex option. In order to get such a setup going you really have to learn how email works from top to bottom. There is no turn-key solution for this that can be set up in half an hour, using some Youtube tutorial. :wink:

I hope my long post helps you at least a little, even if it might not be exactly what you wanted to hear :wink:

Maybe others here have some more suggestions…

Zimbra, hMailServer, Modoboa, and iRedMail are some additional ones to review.

I’ve run Courier email server (MTA and IMAP ) in an enterprise environment for nearly 2 decades.
Using ASSP ( Anti-Spam SMTP Proxy Server download | ) as a internet facing SMTP proxy, and all IMAP access is using IMAPS …Have rainloop ( running for web mail, through an NGINX proxy.

I am using Mailcow-dockerized. Super easy, and is a full featured mail stack with SoGo as a webmail. Works great for me.

Done exactly that 3 days ago. Wanted to host internal Bitwarden and also needed a place that other internal things can send alerts to (Proxmox backups, TrueNAS alerts, Gitlab accounts, etc.) that I wanted to keep on premise.

Used this as a starting point:

This guide is aimed at hosting it on a VPS, so couple sections were skipped and others were updated but it’s useful as a general guideline “what to do next”. Also for security reasons I don’t like running 3rd party scripts written by people I don’t know and fully trust so I grabbed the script mentioned in the tutorial and ran parts of it by hand.

In a nutshell, you could install Postfix, Dovecot, Nginx, PHP and Roundcube and have everything on premise. It’s a great learning experience if you’re into this sort of thing.

If you decide to take on this route and get stuck let me know and maybe I can help.

1 Like