I use iRedMail, which essentially pulls packages from the repository you use and brings them together for you. It uses Postfix, Dovecot, Apache, an SQL DB, OpenLDAP, Cluebringer, Amavisd, SpamAssassin, ClamAV, Roundcube, Awstats, and Fail2ban.
Having been through the adventure of setting up a mail server a couple months ago:
Mail is pretty non-trivial. Compared to setting up apache for basic web serving, configuring a fully fledged email server is the difference between microwaving a hot pocket and baking a cake (not sure why I felt that analogy was needed.)
That being said, there are solutions out there that do a pretty decent job of prepackaging things for you. I've heard nothing but good things about iRedMail (although I haven't toyed with it myself.)
Personally, I find that I always end up tinkering with the internals of things like this, so I took the approach of setting up postfix + dovecot + roundcube from scratch. If you're security-minded and willing to learn, I used a fairly comprehensive tutorial that resulted in a very good setup (I deviated at several spots, but it still turned out well.) In particular, the author covers push notifications, which I really needed (I swapped d-push for z-push, but pick your own poison.)
Using a VPS for email is fine. You could consider having two, in separate parts of the country (or outside the country), but that is a more complex setup as you'll need multi-master configs for all of the datastores involved.
Using a standard linux distro like centos or ubuntu (I'd recommend centos) will set you up nicely to run your own mail server. Using a full on mail server management package like iRedMail will make setting up the server very easy. There are a couple of of extra configuration steps you have to take to make sure large providers accept your mail, but it's very straight forward. Updates to iRedMail are documented and easy to follow, and once it's installed it handles daily backups of email and the databases. Those can be rsync'd, nextcloud'd or however you'd like to get configuration backups off the VPS.
In addition to those steps, you can add a step to the incoming mail handler that will GPG encrypt your email with the keys specified by the recipient address. That solves the problem of securing the emails at rest.
The iRedMail configuration handles closing any open relay issues. It also handles spam very well right out of the box. I would whole-heartedly recommend you leave SELinux in Permissive mode while you exercise all of the options, so you can build SELinux rules to further secure the server. That's also documented and straight forward.
As another poster mentioned, you should continue to encrypt your email outside of any email service if you do not want ~~other people~~ people who are not the intended recipient to read it. You have to understand that the rest of the email chain is insecure - if you're emailing someone with a gmail address, you're using google servers for the mail exchange.
Edit: clarification
I'm no programmer, and I guess being a sysadmin helps a lot, but I've ran my own mail server at home on an old hand-me-down computer for years. Linux + Zimbra make it easy. There are viable, turnkey alternatives to Zimbra these days too. This http://www.iredmail.org/ is getting popular.
First off, a disclaimer: I'm a network/security geek. This is what I do for my home. You may find it to be too much work for you.
I've got multiple systems in place. For starters, I've got a hosted box at a co-location center. It runs Debian. Standard hardened install. In chroot jails, it runs apache to serve up the family website for photo sharing, etc. If I want to send family pictures via facebook, I post them on the web server, then link them. (This allows me to control the content. Items hosted on Facebook become FB's property)
In another chroot jail, I run iRedMail. (http://www.iredmail.org/) It operates as the mail exchanger for my family domain. For the kids mail, I've got whitelists pre-setup, so only pre-approved senders (or domains as you wish) can send email to the child. There's a web mail front end so they can access it via a web browser, or can use Thunderbird.
At the home, I've got Cisco network, configured with WCCP. The WCCP system re-directs all web traffic to a local DansGuardian/SQUID proxy server. I have a certificate installed on all the systems at the house that trust the cert on the DansGuardian box for all SSL encrypted traffic. I maintain multiple SSIDs. Only the kid one re-directs traffic through the DG box. The "guest" is a straight punch to the Internet. There are others for specific purposes.
Last but not least, all the computers in the house run Linux, which reduces the risk for malicious infection, and the kids accounts do not have privileges to modify much.
It isn't fool proof, but so far it's proven to be "teenager" proof, when we had some house guests for a week+.
iredmail, docker containers etc.
kolab also was not that difficult to set up last time I tried.
In any case, having all that magically set up for you, while convenient, seems like just asking for trouble down the road when something goes wrong (security, spam etc).
TL,DR: Setup is easy and takes almost no time. Its all the stuff after that will take all your time.
I havent used mail in a box but I have used iRedMail. I would guess using their installers will be about the same which takes almost no time at all. Once done it is fully functional for sending and recieving emails. Its not an open relay and has a few security best practices implemented which is extremely helpful in getting going quick. If you stop your configuration here then I would say you could have it done in less than an hour at just about any skill level but there would still be a LOT of problems you run into in the future. To both learn and implement a server with a proper security setup (this will be a forever ongoing process), proper DNS settings, dealing with spam listing (if you let someone other than yourself use it), learning config files and understanding what something does before changing something it were the biggest things I ran into right away. Its really not something you want to go into thinking I will just run this installer and be done with it. It will take a lot of learning, google searching, trial and error and most importantly plenty of beer.
Give iRedmail a go, it's not too bad. http://www.iredmail.org/ Aslong as it's IMAP/POP, it can be accessed by multiple devices.
To be honest, if your company has about 70 employees, I would go with Google Apps. Started using it a few years ago with 40 employees when the Exchange server choked, now with ~100 and it just keeps getting better. The Google Docs collaboration is really nifty and saves emailing documents back and forth. It will save you a lot of headaches in the long run.
https://mailinabox.email/ turns a cloud server into a mail server, super easy to install, can't really make config changes.
http://www.iredmail.org/ or https://github.com/tonioo/modoboa probably both work for your rasberrypi. (I haven't tried either but both are linked from the mailinabox site, and I've heard great things from iredmail.
But if you run it at home I suggest you check if mail ports (25,110 etc) are blocked by your ISP. As they might be as it's an easy way to combat spam.
Also install all your mail to a USB HDD instead of the internal SDCard as it will ruin your sdcard alot faster.
Its funny how hard it is to install (full) email server. If you want to use php, apache and mysql, you just install those with one command and everything works with zero config. If you want email server you need huge amount config to even get it working and still you get loads of spam
There are things like mail-in-a-Box and iRedMail but I really dont know if those are any secure to use
Use a clean VM and install this. It installs all the package maintainer files and then modifies the configurations to make everything work. You can work from there or just use it as examples of how things should be configured.
You can give hosting it yourself a go, personally I would use something hosted. Any moment your server or internet is down is time that emails to you will be bouncing back or otherwise not playing nice. Google Apps is probably the most robust solution, these days it's $5/m or $50/y per person.
Otherwise, rather that rolling your own linux setup there are a couple all in one packages this or this for instance) that would probably be the easiest option.
Try iRedMail for Lunix. For DNS, you can host your own DNS, use Go Daddy for DNS or Cloudflare. When I used to host my own servers(Windows), I used hmailserver for email, apache for web, Cloudflare for DNS. Make sure your ISP will allow you to host server. Most homes have dynamic IP addresses which is grey or blacklisted on many spam filters.
I would have heavy read/write run for a while. Sometimes the controller just quits and then your RAID desintegrates. Rebuilding a RAID is something every controller should be able to do, but if it stops beeing a RAID halfway without you noticing thats really bad.
Maybe, you should consider using ZFS. ZFS is absoluty awesome. And since it is its own drivemanager, you dont need to even rely on the RAID card. You basically only need it if you are short on ports.
Thats pretty cool with the business line. :) Check out /r/homelab .
Also, good luck with the mailserver, you might not know it yet, but mailservers are actually the devil. Here is one that usually works: http://www.iredmail.org/
if you only do some mail stuff...*
thats basically only a script that will set up postfix, spamassassing, etc. for you, but that pretty decently (even fail2ban and some basic iptables config in there) and in under 2min.
i use it regularly for clients' standalone mailservers.
.* if you want to add more services, thats not a problem, but some more advanced linux knowledge is needed then.
Edit: i just saw that username...:-)
iRedmail gives you, maybe, a decent start. You can build an LDAP or a SQL database of users. It's not perfect, but it handles the various domains and the install is pretty easy.
DNS is done by your DNS provider. Cloudflare does this, or your domain registrar are the two options I'm familiar with... Try this page to begin with... http://www.iredmail.org/docs/setup.dns.html p.s. you can check all of these records via https://mxtoolbox.com/ just to be sure everything is working as it should be...
I think it's the same link but yours took me straight to the documentation. Anyway it works well for me. And I use sogo as the web interface. Also you can set up activesync with it which I really like. Hope this helps
There is ambiguity in the term "mail server." It looks like you want a solution that collects numerous services including sending and receiving email as well as a web interface for configuration and user access to their emails.
Zimbra is the go-to open source solution right now. We run it for about 20 users, but we do provide substantially more resources than you are proposing. The VM our version of Zimbra runs on has 16 GB RAM, 500 GB hard drive, and 8 VCPUs. Zimbra does provide a lot, though. It includes calendaring and indexing of emails and a very capable web interface to individual email accounts (including mobile support).
The solution you mentioned, iRedMail, is new to me. I'd be curious if there are other competing packages.
Some of the other responses you are getting refer just to the "message transfer agent" or MTA. That is a perfectly reasonable interpretation of the words "mail server," but it refers exclusively to the tools that provide the SMTP service. Those include Postfix, Exim4, and the venerable Sendmail (notorious for its difficulty to configure), but they are only part of what you get with something like iRedMail or Zimbra.
Sorry I didn't go through your 10 comments. I went by what you said in the OP where it seemed that you were reluctant to run your own mail server.
Here's an open source control panel that I've heard good things about. There's also a guide here if you want to do it manually:
https://vpsboard.com/topic/1506-running-your-own-mail-server/
With iRedMail I currently have 4 domains handled by one Centos 6 64-bit VPS. You can send/receive, create accounts and have access to some webmail software. It requires a fresh install, but will set itself up and will then allow you to configure it. Every morning I wake up with 3 emails (optional I believe) that give me statuses of the VPS. There are some post-install instructions on their site regarding MX records and other things. You can also configure it for secure SMTP services if you have websites or other things you'd like to send Emails from.
Edit: I just realised you're probably talking about outgoing messages marked as spam. Whoops. It's annoying, but there's really not a whole lot you can do unfortunately. I wouldn't be put off running your own server because of it though. I'm guessing the likes of Outlook use pretty complex spam detection methods aside from the usual SPF/DKIM/rDNS verification. My mailsever's domain for example is a gTLD with Whois Guard, which could cause issues. I think there's a way to contact Microsoft (or maybe that was Google) and get a reason why certain mail is marked as spam, though it's been a long time since I've bothered trying to get to the bottom of it - I just accept it now and tell friends to mark the mail as "Not Junk" so that hopefully Outlook learns.
Only one of my mailboxes receives spam, and the majority of it is marked as spam and sent to the spam folder. I configured Bayesian filtering a while back which greatly helped. If I recall correctly I used the iRedMail web interface for a little while so that it'd learn what was spam - now I use Thunderbird and spam continues to go to the spam folder. ClamAV also helps with spam detection with bad attachments.
I used iRedMail. When I set it up, if I recall it was setup super quick. Adding email aliaes is part of the "pro" admin panel, but in reality if you know your way around MySQL, it's really trivial to do.
Didn't bother looking at anything else honestly, I just use that and thunderbird/cel phone, and webmail in a pinch (I rarely use it though - the webmail). The basic web admin panel makes adding multiple domains to host easy to do, as well as creating users.
Since I spent maybe an hour setting it up (more like looking at stuff I had no reason to touch after the initial config) over a year ago, I've yet to touch it - it just works. The power of Linux yo. My Exchange 2010 server at work though, I'm forever fucking with that thing ....
I have no idea how purists like it. I just wanted something powered by Linux, was easy to install, and just worked without having to edit a bunch of config files.
I came up with a few ways to circumvent this there are probably other ways
setup a mandrill account its 12k emails sent/month free, and get dydns email forwarder use both as an inbound/outbound connector on exchange 2013 or postfix. use dyn to forward to a non standard port inside your network. You'd basically use mandrill for outbound proxying, and dyn for inbound proxying.
setup a vps somewhere outside of your network for $5/mo (you can use DigitalOcean) combined with iredmail its pretty easy takes 15 mins from vps creation and imo the easiest to setup. But for us homelaber's thats not always the best choice... we do this to learn right? :)
With an acceptable knowledge of Postfix you can get this up, running, and secured relatively easy:
If you can use an external mailserver you still probably should though.
If you use that, email isnt that hard really. Everything you need to have email, aswell as a web gui for managing user accounts and webmail.
Been using that myself for a long time now, works wonders. PS: dont forget to do your DNS settings.
Check out http://www.iredmail.org/ . It's a set of scripts that detects your distro(Debian, RHEL based, ubuntu, etc...) and pulls packages from the distro repos and configures them. You then have to set up DNS, add users and you're up and running. The documentation is pretty good for each distro.
The only downside is it's a bit of a memory hog because of the spam/virus scanning. It requires 1GB of RAM plus the overhead the OS needs to function. I'm running mine on a VM with 512 MB of ram, so I just made a huge swapfile and deal with the latency, since I'm the only user and it's only email.
Exim and Postfix are generally well regarded 'cause their openness.
If running a mail server, have you considered iredmail for that box? http://www.iredmail.org/ have you allocated the risk of getting in the black lists for major mail distributors?
I see. Well, when I say RHEL, i also mean CentOS. The mere difference is paid support; they are binary 100% compatible. I think you can get zimbra working on FreeBSD. Since you don't need enterprise level systems, I guess the OS does not matter. Also, you could see how this software group does it and maybe emulate? http://www.iredmail.org/
This one is close, you need a brand new server though: http://www.iredmail.org/
They limit the free one's admin panel, but its all virtual based in the database, if you know your way around, you can code up your own way to manage the full features it has already setup.
> iRedMail
I hadn't - I am now though :)
Ah - looks like many of the features I want are in the paid version only (http://www.iredmail.org/admin_panel.html). Delegation of user as domain admin and user ability to setup aliases both require iRedAdmin-Pro.
$600 (or $300 a year) is more than I can spend on this.
Bah.
I don't run mail servers anymore, but with the last one i got lazy and just used iRedMail. Postfix for MTA, dovecot for POP/IMAP and amavis, spamassassin, clamav to filter the bad stuff.