When you decide to set up your own mail server, the first thing that comes to mind is reliability. You need a tool that can handle the email traffic, won’t crash at the worst possible moment, and won’t trap you in endless complicated configurations. One such tool is Exim4.
Exim4 is not just another mail-sending program. It’s a reliable mail transfer agent (MTA) that can receive emails, route them to the right recipients, and send them further. It supports encryption, filtering, connection to external SMTP servers, direct mail reception, and custom processing according to your needs.
Why Exim? Because it’s flexible. You can tailor it for any task — whether it’s a small home server or a large mail service with thousands of users. The key is not to be afraid of the settings. And here we’ll show you how to configure it without unnecessary pain.
It couldn’t be simpler. Open the terminal and run:
sudo apt update
sudo apt install exim4 -y
And that’s it! The mail server is installed.
Also very straightforward:
sudo yum update
sudo yum install exim -y
By the way, the "-y" at the end just auto-confirms all installation prompts. You can skip it if you prefer to confirm each step manually.
Sometimes the version you need might not be available in your package manager. In that case, you can download it from the official website and build it yourself. For example, to get version 4.98:
wget https://ftp.exim.org/pub/exim/exim4/exim-4.98.tar.gz
Need an older version? Look for it in the “old” directory on the same website.
Check the installed version with:
exim -bV
Want to make sure mail is actually going out? Send a test email to yourself:
echo "test letter" | exim your@emailaddress
The easiest way is to launch the configuration wizard:
sudo dpkg-reconfigure exim4-config
You’ll see a step-by-step interface where you can:
→ Choose how the server will operate — standalone or via another SMTP server.
→ Set your server’s hostname.
→ Configure which IP addresses can receive emails.
→ Specify domains if needed.
→ Provide an external SMTP server if you’re sending mail through it.
→ Decide whether to hide the server name in email headers.
→ Configure how the settings are saved.
When done, apply the changes:
sudo update-exim4.conf
Your settings will be saved, and your server will be ready to go.
Open the configuration template:
/etc/exim4/update-exim4.conf.template
Make the necessary changes and apply them:
sudo update-exim4.conf
Check its status with:
sudo systemctl status exim
And don’t forget to check the logs:
/var/log/exim/
That’s usually where you’ll find useful hints.
If another MTA like Postfix is already running, stop it:
sudo systemctl stop postfix
sudo systemctl disable postfix
Check for configuration issues with:
exim -bV
If there’s a problem, you’ll see the line number and error description. Just open the file and fix it.
Exim4 isn’t the only MTA out there. Here are a couple of solid alternatives:
One of the oldest and most flexible mail servers. But be warned — it’s not easy to configure. One wrong space can break the entire setup.
A more user-friendly and secure option. If you’re looking for something simpler yet reliable, Postfix is a great choice.
Exim4 is a powerful tool that works for both small home projects and large mail services. It doesn’t limit your customization options, lets you manage email the way you prefer, and doesn’t require advanced knowledge to get started with a basic setup.
Want full control over your server’s email? Give Exim4 a try — you’ll see that running a mail server doesn’t have to be complicated or intimidating.