Ideas for Setting Up a Mail Server to Replace a cPanel Server

I know how to set up mail servers. What I don’t know is how to get the accounts (including passwords) out of the cPanel backup, other than doing a Virtualmin migration. It’s just not something I ever had occasion to do.

I don’t mind buying another Virtualmin license if that’s the best way to do it. But because the server will only be handling mail, and only for two domains, that may be overkill. Most of the functionality would not be used.

I do want the mail server to have some sort of panel. I’m not a spring chicken. Making life easier for whomever takes over when I retire or die is part of everything I do these days. Maybe Webmin?

What I don’t know is how to extract the accounts from the cPanel backup. Is there some kind of encryption? Or do I just extract the archive and copy the Mail directory into the new server?

The configuration I want on the production server is:

  • Rocky Linux (probably 9.x, but maybe 8.x if there’s a good reason).
  • Postfix, Dovecot, and Procmail. Postfix has grown on me, Procmail is essential to a specific need of the client (forwarding certain mails to SMS/MMS), and everyone loves Dovecot. I’ll also want SpamAssassin and some sort of virus scanner (ClamAV is probably good enough).
  • It will need Apache and PHP 8.1 or 8.2 to run Roundcube and maybe other Web-based things, but it will not be serving any production Web sites.
  • I want CSF for various reasons, not the least of which are that I’m familiar with it and it feeds my blocklists.
  • I want a panel of some sort. Virtualmin, Webmin, maybe even Cockpit. I don’t really care because I’ll rarely use it. I’m thinking about the next guy or gal. It should have the ability to create and terminate email accounts and keep the server updated.

I have a dev server in my office running Virtualmin GPL on Rocky that can be used to extract the cPanel archive, if necessary. Maybe migrate the backup into that, throw away everything except the mail, and then copy it into a new account mail.domain.tld?

The actual server will be a high-end VPS at Turnkey Internet that’s currently running cPanel on CentOS 7.9, with immaculate IP’s, which will be clean-installed to Rocky 8.x or 9.x as part of the mail migration.

This is probably an easy thing, but I’ve never done the extraction from the cPanel backup part; so that’s the part I’m looking for specific advice about. I appreciate any input.



EDIT: One of the accounts doesn’t actually have any email accounts. It needs SPF, DKIM, and DMARC because it sends no-reply responses to forms, and it needs the mandatory addresses (which are aliased to the other domain); but it doesn’t have any actual email accounts of its own.

You may not need Pro features for just mail. There are no major mail-related features in Pro, except for cloud-oriented stuff. Your description of your wants has none of that.

Since you’ve just described our default mail stack (and nobody else’s, AFAIK, cPanel uses exim, Plesk doesn’t use procmail, most commercial mail offerings have their own things for at least some of the components), seems like an easy choice. :man_shrugging:

1 Like

Okay, thanks.

So basically just migrate the backup like any other, empty the Web directories to save space, and request a cert only for mail.

There also are a bunch of subs that are in DNS, but that never send or receive mail. I suppose I can delete them and remove their mail entries from DNS on the server hosting the nameservers (the one I set up last night). Maybe I should cluster the nameservers while I’m at it.

The server will have a functionally-identical configuration as the dev server in my office, so I can download the backup and play with it before doing the upgrade.

I also set up Roundcube on the new server pointing to the old one, so the mail should be available almost immediately to both device and Webmail users immediately while I’m doing the rest of the stuff I want to do.

Thanks again,


Actually… I can delete the subdomains from cPanel before I make the backup. The new server is serving them, and there’s no mail on the subs. So that solves that problem.

By the way, splitting the Web server off from the mail server dramatically improved the page load times, at least to a bot’s eyes.


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.