Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Switch the Mail Server on a VPS or Dedicated Server

This guide explains how to change the mail software on a server running WHM and cPanel. It needs root access.

Web Hosting2 min read10 steps

What is a mail server?

A mail server is the software that sends and receives your email, like a post office inside your server. On a cPanel server, mail software has two jobs. One program sends and routes mail. Another lets people read their mail from phones and apps. Common names are Exim, which sends mail, and Dovecot, which lets you read it.

WHM is the admin panel for a cPanel server. Only the server owner can see it. The names below are the ones in many WHM versions. Menu names can change, so use the search box in WHM if you cannot find them.

Warning: Changing the mail server can stop email for a short time. Some changes also affect how mail is stored. Take a full backup first, and pick a quiet time.

Steps in WHM

  1. Log in to WHM as root. Your login details are in your welcome email.
  2. In the search box at the top left, type Mailserver.
  3. Click Mailserver Selection.
  4. Read the current choice shown on the page.
  5. Choose the mail server you want from the list.
  6. Click the button to save or apply the change. The screen may show a progress log.
  7. Wait until it says the job is done.

The choices depend on your version of cPanel. Some versions allow only one option. If you see only Dovecot, the system does not offer another one.

Check that mail works

  1. Send a test email from webmail to another address.
  2. Send an email back to your address.
  3. Connect with a mail app such as Outlook or Thunderbird. Check that it can read mail.

Check the service from SSH

Connect to your server with SSH as root and run:

systemctl status exim

This shows whether the Exim service is running.

systemctl status dovecot

This shows whether the Dovecot service is running.

If one is stopped, restart it with /scripts/restartsrv_exim or /scripts/restartsrv_dovecot.

If something goes wrong

  • Switch back to the old option in the same screen.
  • Restore from your backup if mail is missing.
  • Look at the log file /var/log/maillog for clues.

If you are not sure which choice is right for you, open a support ticket before changing anything.

Quick recap

  • Use WHM, then Mailserver Selection, as root.
  • Back up first, because mail can be disturbed.
  • Test sending, receiving and mail apps.
  • Check service status over SSH if needed.