User Tools

Site Tools


Build Your Own Mail Server - Page 1

1.0 Introduction

For getting on for 20 years, I've used the likes of Yahoo!, Outlook, Zoho and (of course!) Gmail to handle all my email needs, using their native redirection capabilities to make everything I send and receive appear to be using my email address regardless of which industry behemoth was actually handling it behind the scenes. They are, after all, ubiquitous, free and reliable -and the fact that no Secret Service guys have come kicking down my front door perhaps indicates that, as far as privacy is concerned, they aren't all that bad either.

On the other hand, it's undeniably true that if something is free, the chances are that you are the product! More simply, if it's run by the likes of Google or Microsoft, your email isn't truly your own but, at least in part, theirs. So, whilst supping with the devil, I've always rather hankered to run my own email infrastructure.

Except that everyone -and I really mean practically everyone!- will tell you not to do so. A good article illustrating at least some of the difficulties is available here. In a nutshell, it's got more moving parts than a good Swiss wristwatch; it's complex to maintain; your antispam and antivirus measures are unlikely to match those of Google or Microsoft; your email reputation may suffer, such that you end up on all sorts of blacklists, so that your sent mail never gets through to its recipients… and there's probably plenty more reasons I can't be bothered to summarise.

So, faced with a choice of signing up to the industry players or rolling my own, I've always wanted to roll my own …but gave in like everyone else and signed up with the Big Boys.

Until yesterday.

Yesterday, I built my own email infrastructure so that email is unequivocally mine, now. It is secure (though I'm not challenging anyone to prove me wrong!). It's cheap (but not free). And, in these post-Snowden days, it's as private as I could wish. It was also surprisingly painless to set up (though, if I'm being honest, should anything go wrong, I'm fairly sure it will be a devil of a job to troubleshoot it!)

Despite the painlessness of the setup, I thought I'd document the entire process -should I ever need to re-do it in the future. If the story persuades you to take back control of your own email infrastructure, so much the better!

For the purposes of this article, I'm going to create a new domain ( and build a new server in the cloud acting as the mail server for that domain.

2.0 Get a Domain

You need a domain name that you control and administer before you go any further. They aren't always cheap to buy and it pays to shop around multiple resellers before you commit to one in particular. Watch out for deals which are ridiculously cheap for the first year but cost an arm and a leg to renew in second and subsequent years! Also watch out for domain registrars that will provide you with a cheap domain name but then charge extra for DNS services. DNS is the service which maps a domain name to the server IP address that's hosting it: it's essential and you want it to be part of the domain registration package, not a bolt-on extra.

Now, I don't do product endorsements, but when writing this article, I found these guys:

Notice that Namecheap do the 'cheap this year, expensive the next' trick, but at least they are up-front about it and tell you clearly that next year will cost 6.5 times what this year will. Good enough for me!

So: I add that domain name to my shopping basket, go to check out -and make sure no added extras are silently appended to my bill! Another thing I liked about Namecheap: yes, the extra services are all displayed at checkout, but none of them are actually selected, so there are no additional costs. Not something every registrar, in my experience, can say! There is one extra that's automatically enabled: WhoisGuard, which keeps your domain registration details (including phone number and email!) private. That's a worthwhile thing to have -and Namecheap do it for free. So having that automatically added to your bill is OK, because it doesn't make it any bigger!

At checkout, you are required to create an account with the registrar -usual rules apply: you must part with name, address, an already-functioning contact email address and so on. You then supply the domain administrative contact details -for my part, these can be left to default to the name & address details I've already supplied. You then part with your credit card details, with an option to auto-renew the domain next year. Auto-renewal is probably a good idea if you intend to keep a domain for the long-term: if a domain ever expires, it can be next-to-impossible to re-acquire and re-animate it. You can always switch auto-renewal on or off later on, of course.

Once payment has been made: you own a domain name! You will probably receive an email from the registrar requiring you to verify that you received it (by clicking a link it contains). This is a formality that is required to ensure that domains belong to people who can genuinely be contacted by email (though disposable email accounts make that a bit of a silly goal to pursue, to be honest!). Verify your email address when prompted.

Now you can move on to making your new domain actually do something!

Page Selector

1 2 3 4 5 6 7 8 9 10
wiki/linux/mailserverp1.txt · Last modified: 2019/02/02 10:15 by dizwell