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:
I have various systems that can send email alerts and I don’t want to send those externally.
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.
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.
I hope my long post helps you at least a little, even if it might not be exactly what you wanted to hear