Peterborough Linux User Group (Canada) Forum

Linux & Android => Articles, Tutorials and Tips => Topic started by: Jason on January 04, 2020, 01:47:55 PM

Title: I set up a mail server!
Post by: Jason on January 04, 2020, 01:47:55 PM
Setting up a mail server on Linux can be a complicated process. I tried doing it with Postfix and sendmail on my own and didn't get very far. But for those trying to do it themselves, I found a much easier way. It's called Modoboa and you can find a good tutorial here (https://www.linuxbabe.com/mail-server/email-server-ubuntu-18-04-modoboa). Modoboa automates the install of the pieces you need for a full-fledged mail server which includes webmail access. The tutorial also tells you how to modify the DNS records. The features of Modoboa are:
There were a couple of snafus, one of which was due to something they left out and wasn't mentioned in the tutorial and the other was my fault. Their error was omitting how to set up the FQDN which one piece of the software wouldn't work with out. I found a tutorial here (https://www.hiroom2.com/2018/05/30/ubuntu-1804-hostname-en/) for that, so do that first before following the Modoboa tutorial, or after you get an error about not having a FQDN if that's the way you fly. The other issue was that I had already hardened my Linux server which included configuring and enabling the firewall. But that plan was for a plain webserver that didn't allow the mail protocols. Setting up the firewall is addressed in the Modoboa setup so do any hardening afterwards.

I had tried iRedmail but it didn't work for me. Modoboa is nicer and gives you a web-based interface much earlier in the process than iRedMail.

I already have created and tested the mail server and can send/receive emails for my personal domain - jasonwallwork.ca. It works beautifully. I have the mail server hosted on a DigitalOcean (https://m.do.co/c/489c9788619b) VPS (same as PLUG). Use that link and you get $100 credit for 60 days to try them out. I do get a $25 one-time kickback if you end up buying $25 of hosting from them. The server costs $10 CAD/month + taxes because you need 2 GB RAM to host it. It's a bit of an advert but I'm very happy with their services and wouldn't mention them if I wasn't.

Soon I won't need to use corporate email like Yahoo, Gmail or the like. And like a phone number, I can take my domain name everywhere I go if I change hosts. I'm not stuck with one provider. And I don't have to deal with adverts or have my privacy diminished with profiling.

If any of you or anyone you know wants to set one up and lacks the technical expertise, please let me know and I'll get in touch with them. Or pass on my email address since most of you have it.
Title: Re: I set up a mail server!
Post by: Jason on April 17, 2020, 09:04:53 AM
Another topic of mine that died in childbirth. :D
Title: Re: I set up a mail server!
Post by: fox on April 17, 2020, 11:05:56 AM
I've been using Thunderbird since forever and my Trent mail, for better or worse, is run on Microsoft's server. I always enjoy reading about the things you try and post on the site, but only some are things I want to do myself. But by all means, keep posting your ideas and the things you try!
Title: Re: I set up a mail server!
Post by: Jason on April 17, 2020, 08:46:38 PM
You can use whatever client you want with this - it's just a mail server, although the just part makes it seem easy which it wasn't. You can use the web mail client if you want, but it doesn't really have a lot of features. Some people might not realize that Gmail also lets you access outside mail servers.


I'm curious, when you said that Trent mail is run on Microsoft's server, you mean MS software, right? I'm guessing an Exchange server which I've never had any experience with. It's too bad they do it that way, my guess is that they pay huge licensing fees to do that when they could just be using open source software. I believe they used to do it that way once, that all the universities ran Unix servers that handled everything.


Thanks for replying. I was just wondering if anybody actually read this, from the group, I mean. I'm sure the bots have. :)
Title: Re: I set up a mail server!
Post by: fox on April 17, 2020, 11:09:29 PM
Quote from: Jason Wallwork on April 17, 2020, 08:46:38 PM
....
I'm curious, when you said that Trent mail is run on Microsoft's server, you mean MS software, right? I'm guessing an Exchange server which I've never had any experience with. It's too bad they do it that way, my guess is that they pay huge licensing fees to do that when they could just be using open source software. I believe they used to do it that way once, that all the universities ran Unix servers that handled everything.
....
No, I meant Microsoft's server, and probably it's an Exchange server. Trent didn't used to use Microsoft for this; they used to have their own servers and I have no idea whether they were open source or not. Trent has some kind of broader arrangement with Microsoft - all faculty and students get Office 365 for free and I am allowed 5 installs of Office 2019. (Doesn't do me any good on Linux.) We get OneDrive accounts free through the university as well, but I don't use it. I don't know if we pay huge fees; I think Microsoft would give this to universities for a pretty low price to get all their students and faculty hooked on their software.
Title: Re: I set up a mail server!
Post by: ssfc72 on April 18, 2020, 12:44:46 AM
Thanks for the info and your experience in setting up a mail server, Jason. 
I still have to get around to trying to set up a webpage server box using Apache or NginX.  After I get that done then I would also like to try the mail server setup, as well. :-)
Title: Re: I set up a mail server!
Post by: Jason on April 18, 2020, 01:22:45 AM
If you need help with apache or nginx, let me know. I'm more familiar with apache but I've used nginx a bit.
Title: Re: I set up a mail server!
Post by: fox on April 18, 2020, 07:27:02 AM
Do post about your experience if you go ahead with it, Bill.