Once your own mail server is sending and receiving, the real work begins: choosing and tuning the mail transfer agent, making Dovecot fast, filtering mail on the server, and keeping spammers and password-guessers out. This guide covers those advanced tasks for a server you run yourself, such as a VPS. It assumes you already have a working Postfix or Exim with Dovecot, and it applies to your own server only, not to shared hosting.
Pick one MTA and stay with it: Postfix is simpler and secure by default, Exim is more flexible through its ACLs. Tune Dovecot with its split config files and check the result with doveconf -n. Filter mail server-side with Sieve (Pigeonhole), give users Roundcube with the managesieve and password plugins, and protect the server with SPF, DKIM and DMARC, a modern spam filter such as Rspamd, rate limits and Fail2ban. Watch the queue and the logs every day.
Everything here needs root access on a VPS or dedicated server you manage. On Domain India shared hosting, the mail server is run for every account on the server and you can't change its configuration; use the email tools in your control panel instead. If you just want reliable mailboxes on your domain, Business Email (section 7) is far less work than running a mail server.
1. Postfix or Exim?
Both are mature, maintained and widely used. Choose on how you want to manage policy, not on speed.
| Question | Postfix | Exim |
|---|---|---|
| Default security | Secure by default; small, separated processes | Needs more care; flexible defaults |
| Configuration | main.cf and master.cf, key-value settings | One config with routers, transports and ACLs |
| Custom policy | Restrictions plus policy services and milters | ACLs can express almost any rule inline |
| Packages (AlmaLinux/Rocky) | Base OS | EPEL repository |
| Used by | Most distributions' default | cPanel and DirectAdmin servers |
Switching MTA on a live server is rarely worth it. If you must, do it in a maintenance window:
# AlmaLinux / Rocky Linux example
sudo cp -a /etc/postfix /root/postfix-backup-$(date +%F)
sudo dnf install epel-release
sudo dnf install exim
sudo systemctl disable --now postfix
sudo alternatives --config mta # choose sendmail.exim
sudo systemctl enable --now eximThen rebuild your settings in Exim (relay rules, TLS certificate, authentication through Dovecot, local delivery to Dovecot over LMTP), test with exim -bV and exim -bh 203.0.113.10, and send test mail both ways. Mailboxes stored by Dovecot in Maildir don't need migrating, because Dovecot, not the MTA, owns them. MX records don't change either, as long as the server's hostname and IP stay the same.
For writing Exim rules, see the custom Exim ACL guide.
2. Tuning Dovecot
Check your version first with dovecot --version. The examples below use Dovecot 2.3 syntax, which AlmaLinux and Rocky Linux ship. Dovecot 2.4, found in newer distributions such as Debian 13, renamed many settings (for example, mail_location was replaced), so use the 2.4 documentation if that is what you run.
Settings live in /etc/dovecot/conf.d/, split by topic. Useful ones:
# 10-mail.conf: Maildir in each user's home
mail_location = maildir:~/Maildir
# 20-imap.conf: connections per user from one IP (default 10)
protocol imap {
mail_max_userip_connections = 20
}
# 10-master.conf: allow more simultaneous logins on a busy server
service imap-login {
process_min_avail = 4
}- Raise
mail_max_userip_connectionsonly if users with several devices behind one office IP hit the limit. - Put mail on fast storage. Dovecot's index files make large folders fast, and NVMe storage helps most on busy servers.
- Compression saves disk space for large archives; in 2.3 it is the
zlibplugin, in 2.4mail_compress.
After every change, check the effective config and reload:
sudo doveconf -n | less
sudo systemctl reload dovecot3. Server-side filtering with Sieve
Sieve filters run on the server as mail is delivered, so they work the same in every mail app. Install Pigeonhole (dovecot-pigeonhole on AlmaLinux and Rocky Linux), then enable it for local delivery:
# 20-lmtp.conf
protocol lmtp {
mail_plugins = $mail_plugins sieve
}
# 90-sieve.conf
plugin {
sieve = file:~/sieve;active=~/.dovecot.sieve
}A simple script that files tagged spam into the Junk folder:
require ["fileinto"];
if header :contains "X-Spam-Flag" "YES" {
fileinto "Junk";
stop;
}Compile it with sievec and test it against a saved message with sieve-test. Enable the ManageSieve service so users can edit their own filters from webmail.
4. Webmail: Roundcube and alternatives
Roundcube is the standard choice and is actively maintained. Plugins worth enabling:
managesieve: users edit their Sieve filters and vacation replies;password: users change their mailbox password;markasjunk: users train the spam filter;archiveandzipdownload: tidy folders and download messages.
Enable plugins in config/config.inc.php (or /etc/roundcubemail/config.inc.php for a distribution package):
$config['plugins'] = ['archive', 'zipdownload', 'managesieve', 'password', 'markasjunk'];Keep Roundcube updated; webmail faces the internet and is a frequent target. Maintained alternatives include SOGo (mail, calendar and contacts with ActiveSync) and SnappyMail. Avoid SquirrelMail and RainLoop, which are no longer maintained.
5. Security: stop abuse in and out
An Exim rate limit for authenticated senders, in the RCPT ACL:
deny authenticated = *
ratelimit = 200 / 1h / per_rcpt / strict / $authenticated_id
message = Sending rate limit exceeded, try again laterA DNS blocklist check in the same ACL:
deny dnslists = zen.spamhaus.org
message = Rejected: $sender_host_address is listed at $dnslist_domainSpamhaus refuses queries that come through large public resolvers, and it has usage terms for commercial and high-volume use. Run a local caching resolver such as Unbound on the mail server, and read the list operator's terms before you rely on it.
Also require TLS for logins (ports 465, 587, 993 and 995), disable plain-text authentication on unencrypted connections, and keep the OS and mail packages updated.
6. Monitoring and alerts
- Queue size:
mailqorpostqueue -pfor Postfix,exim -bpcfor Exim. A queue that grows suddenly usually means a compromised account or a blocklisting. - Daily reports: Logwatch summarises logs;
pflogsumm(Postfix) andeximstats(Exim) report volume, rejects and top senders. - Blocklist status: check your server IP against the major blocklists regularly, and after any spam incident.
- Deliverability: watch DMARC aggregate reports and the postmaster tools of large mailbox providers.
- Alerts: have your monitoring system alert on queue size, disk space and failed-login spikes, not only on the server being down.
7. Where Domain India fits
Your own mail server on a VPS. Our VPS plans give you root access and are self-managed, so the MTA, Dovecot, spam filtering and deliverability are yours to run. The VPS page says you can set custom reverse DNS (PTR) records for your IPs from the client area, which a mail server needs. Before you build, ask support whether outbound port 25 is open for your VPS.
- 1 vCPU
- 2 GB DDR4 RAM
- 64 GB NVMe SSD Storage
- 2 TB Monthly Bandwidth
Or let us run the mail. Business Email gives you mailboxes on your own domain without running a server: webmail with calendar, contacts and tasks, IMAP and SMTP over TLS, DKIM signing on every message, SPF and DMARC records provided, two-factor authentication, and mail filters. It is priced per mailbox.
- Priced per mailbox - start with one
- Email at your own domain ([email protected])
- Add and remove mailboxes yourself
- Webmail with calendar, contacts and tasks
The cards show live prices, excluding 18% GST. On 19 September 2026, Domain India list prices were ₹553 a month for VPS Starter and ₹60 a month per Business Email mailbox.
Should I use Postfix or Exim on my mail server?
Either works well. Postfix is simpler and secure by default, which suits most self-managed servers. Exim is more flexible because its ACLs can express almost any rule, and it is the MTA used by cPanel and DirectAdmin. Switching a working server is rarely worth the risk.
Do I need to migrate mailboxes when I switch from Postfix to Exim?
Usually not. When Dovecot stores the mailboxes in Maildir, Dovecot owns them and the MTA only delivers to it. You rebuild the MTA settings, point local delivery at Dovecot, and test.
Can I change the mail server settings on Domain India shared hosting?
No. On Domain India shared hosting the mail server is managed for every account on the server. Use the email, filter and spam tools in your control panel, or run your own mail server on a self-managed VPS.
Why does my self-hosted mail go to spam?
The usual causes are missing SPF, DKIM or DMARC records, no matching reverse DNS (PTR) record for the server IP, an IP on a blocklist, or a compromised account sending spam. Fix authentication first, then check the blocklists and your logs.
Is running my own mail server cheaper than Business Email?
Only if your time is free. A mail server needs constant patching, spam filtering, blocklist monitoring and deliverability work. For a small business, a managed mailbox such as Domain India Business Email is usually the better choice.
Ready to decide? If you want full control, start with a self-managed VPS. If you just want reliable mail on your domain, see Business Email. Questions? Open a support ticket or use the 24/7 live chat.
Mailboxes on your own domain, with webmail, DKIM signing, SPF and DMARC records and two-factor authentication.
See Business Email