Email Server?

I would like to try my hand at deploying/running an email server.

I have an account at Linode so I would like to deploy it there.

My rational

  1. Why not.

  2. I need to learn linux and what better way lol. For some reason the command line just psyches me out and I need to get more comfortable. I am way to reliant on a GUI.

I found the [Email Server - Talk Page ] (Email server) But it was locked otherwise I would have added this there.

I know there are a bunch of different solutions out there, I see quite a bit about Postfix

I will do my best to document progress here and hopefully keep myself motivated.

4 Likes

As somebody who previously ran an e-mail server many moons ago (Qmail on FreeBSD), donā€™t do it. Yeah, yeah, I know ā€“ I know, itā€™s not what you want to hear. DNSBL, Greylisting, Backscatter, DKIM, SPF and a whole host of other things needed is a headache.

OK, now on to why you should totally do it ā€“ Itā€™s a learning experience. Youā€™re going to screw up, lose mail, have fun tracking down why mail keeps bouncing, learning about spam filtering, the joys and sadness of working with DNSBLs, your mail server gaining trust ā€“ but most of all, when it does work, itā€™ll be a rewarding experience. For a quick start, look for mailinabox or iRedMail.

Pro tip: MX records should point to an A record. Do not use a CNAME or IP address. Itā€™ll work, but some mail servers out there might have an issue with it.

Also, check with whatever hosting you use allow SMTP traffic, comply with their anti-spam policies, etc. If youā€™re using a VPS, thereā€™s a high probability that itā€™s IP will already be on a DNSBL and will take time for it to be removed.

2 Likes

They donā€™t allow the standard email ports by default, you are going to have to ask their support if you they can open the ports for you.

I setup a postfix/dovecot solution a few months ago and it was actually fun.
I didnt use a VPS, so my PTR record isnt there, but it works well for me.

1 Like

Thatā€™s all you need.

Automagic config, no need for silly postgres and whatnot.

All you need to do is provide it with certs and then dump the SPF/DKIM into your dns config.

4 Likes

@DavieDavieDavie
This is what I need to hear haha. Learning experience and a cause for a headache lol.

@TheCakeIsNaOH
I have seen there little notice on the side when you go to make a new one.

@nx2l
yea I donā€™t think I will keep it up. Just use it a test and go from there.

@SgtAwesomesauce
Seems like cheating lol.

And not gonna lie I am going to need to look up what some of these abbreviations mean
SPF/DKIM?
VPS?

Itā€™s what I use.

Sender Policy Framework

DomainKeys Identified Mail

Virtual Private Server (a cloud instance)


Everyone starts somewhere. Emailwiz is easy mode. Sets it up for you, and itā€™s really easy to read into it and see what itā€™s doing.

Also doesnā€™t have any of that extra bloat that email servers tend to have.

Want a new email user?

useradd -m $user

I concur.

Itā€™s a big hassle and even when you do everything right, youā€™ll still end up blacklisted somewhere. The game is rigged.

Well I guess I donā€™t need to google then haha. Thanks

I guess starting with the simple route and easing into it makes sense instead of piling it all on at once.

1 Like

Thatā€™s what Iā€™d do as well.

@Adubs @DavieDavieDavie
Hmm thats 2 now.

@SgtAwesomesauce
Going to ask more questions. Feel free to tell me its none of my business.
Do you use it just for personal use or are they work/business accounts?

Currently just personal. In the past, Iā€™ve used it for business.

This.

Iā€™m a long term mail server admin (since the late 90s), and basically email is a shit show.

Iā€™d suggest getting someone else to do it, and attempt to migrate your primary methods of communication away from email. because its a never ending shit show of fighting spam via ever more complex means and staying on top of security vulnerabilities.

Itā€™s MUCH MUCH more complicated than you might think, and for reasons of dealing with brain damaged admins on the other side as much as the actual complexity of the technology - which is increasing.

@SgtAwesomesauce has the basics above. but thatā€™s how things are TODAY. shit changes and you need to continually keep on top of it, and any spam assassin filter you have is never going to compete with the filtering in the cloud that has a few million users to hit the spam before you do.

1 Like

Hi

My reasoning for setting up an email server was as follows.

  1. A step in the direction of degoggleifcation.
  2. To learn stuff.
  3. Challenge and reward.

My initial research revealed that the ā€˜classicā€™ Linux email server combo appeared to be Postfix \ Dovecot \ Database.

My write up that you found was the product of many days slow progress and frustration but in the end was an extremely satisfying experience.

I am fully aware I did this on ā€˜hard modeā€™ and that I could have found a turnkey solution or just opened a Proton email account.

That mail server has now been upā€¦

user@host:~$ uptime
07:47:33 up 439 days, 20:47, 1 user, load average: 0.12, 0.13, 0.09

If you want to give it a go I would just suggest you take it slow (you will get annoyed at points) and document every step you make as you go.

You will learn about databases, firewalls, email security technologies, spam, DNS, certificates and many other things.

You will probably find yourself wiping your VM and starting over several times probably. Snapshots are your friend here but even so you might find yourself in a scenario where you want to start over (hence the documentation).

By the end of my experiment I was essentially copy and pasting in 95% of my own documentation in the server in order to test that I had done everything correctly.

It is super rewarding (at least to me) to send and receive your first email on your own server.

You are going to need these along the way.

http://www.postfix.org/documentation.html

https://doc.dovecot.org/

Good luck!

4 Likes

Could there be some paid certs that prevents this? I mean companies run their own email servers and donā€™t get blacklisted. :thinking:

I try very hard NOT to be reliant on Lukeā€™s ā€œ1 button solutionsā€ because I donā€™t like things I donā€™t understand. Assuming that the aim is learning, then going through the hard work of setting up is something worthwhile. But considering the goal is actually:

ā€¦ then I guess Lukeā€™s scripts are ok. They are meant for beginners.

So, to conclude: one wants to learn Linux, go with Lukeā€™s scripts (albeit I would not recommend going into mail servers just to learn Linux), otherwise, learn to set it up yourself.

While not Linux per se, itā€™s still Unix-like, I highly recommend reading and trying to set up a mail server in OpenBSD using OpenSMTPD:

Setting up a mail server is a lot more than ā€œlearning Linuxā€

Itā€™s more learning the intricacies of DNS, SMTP and all the bastard hacks upon hacks to make a protocol that was never secure somewhat less broken so people can use it to communicate.

Learning ā€œLinuxā€ is the easy bit.

I used this guide when setting up a mail server and learnt a fair bit in the process.

http://flurdy.com/docs/postfix/

Make sure your external IP is not on or removed from the Spamhaus PBL.

https://www.spamhaus.org/pbl/removal/

I imagine there are others but this is the only one I put my details into.

My personal email server is run off a domestic IP address and has never been blacklisted. I am fortunate that my ISP allows customers to run servers / services from home. I know this is rare.

1 Like

In my case, having my server be a VPS means that microsoft blanket bans me based on IP. Anyone who signs up to my forum with a hotmail/live canā€™t complete activation.

Thereā€™s nothing I can do about it. Microsoft just tells you to pound sand.

Most every VPS company will block email ports and in some cases they will refuse to open them.

1 Like