{"id":1323,"date":"2024-05-28T15:08:14","date_gmt":"2024-05-28T15:08:14","guid":{"rendered":"https:\/\/hosting-marketers.com\/news\/?p=1323"},"modified":"2024-05-28T15:17:02","modified_gmt":"2024-05-28T15:17:02","slug":"effortlessly-separate-web-and-email-hosting-a-step-by-step-guide-to-setting-up-a-dedicated-mail-server-with-whm-cpanel","status":"publish","type":"post","link":"https:\/\/hosting-marketers.com\/news\/2024\/05\/28\/effortlessly-separate-web-and-email-hosting-a-step-by-step-guide-to-setting-up-a-dedicated-mail-server-with-whm-cpanel\/","title":{"rendered":"Effortlessly Separate Web and Email Hosting: A Step-by-Step Guide to Setting Up a Dedicated Mail Server with WHM\/cPanel"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.23&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_row _builder_version=&#8221;4.23&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.23&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.24.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p><span>In today\u2019s digital landscape, efficiently managing your web and email hosting can significantly enhance your server performance and security. If you\u2019re using WHM\/cPanel and looking to streamline your hosting setup, separating your web and email hosting onto different servers is a game-changer. This approach not only optimizes server resources but also ensures better email deliverability and management. In this guide, we will walk you through the step-by-step process of setting up a dedicated mail server using WHM\/cPanel, making your hosting experience seamless and efficient. Whether you\u2019re a seasoned admin or a novice, our detailed instructions will help you achieve this with ease.<\/span><\/p>\n<p>To achieve automatic email account creation on a separate mail server when a new cPanel account is created on your main server, you can use WHM&#8217;s DNS clustering and custom MX routing features. This involves configuring both servers to work together seamlessly. Here\u2019s how you can set it up:<\/p>\n<h3>Step 1: Set Up DNS Clustering<\/h3>\n<ol>\n<li><strong>Configure DNS Clustering in WHM<\/strong>:\n<ul>\n<li>Log in to WHM on both Server 1 (web server) and Server 2 (mail server).<\/li>\n<li>On both servers, go to <code>WHM -&gt; Cluster\/Remote Access -&gt; Configure Cluster<\/code>.<\/li>\n<li>Enable DNS clustering and add each server to the cluster, ensuring they can communicate with each other.<\/li>\n<li>Set Server 2 as the primary DNS server for MX records.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>Step 2: Configure DNS Zones<\/h3>\n<ol>\n<li><strong>Adjust Default DNS Zone Template<\/strong>:\n<ul>\n<li>On Server 1, go to <code>WHM -&gt; DNS Functions -&gt; Edit Zone Templates<\/code>.<\/li>\n<li>Modify the <code>standard<\/code> DNS zone template to automatically point MX records to Server 2.<\/li>\n<li>Example:\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"overflow-y-auto p-4 text-left undefined\" dir=\"ltr\">\n<p><code class=\"!whitespace-pre hljs language-plaintext\">%domain%. IN MX 10 mail.%domain%.<br \/>mail IN A [IP of Server 2]<\/code><\/p>\n<p><span style=\"color: #333333; font-size: 22px;\">Step 3: Automate Email Account Creation<\/span><br \/><code class=\"!whitespace-pre hljs language-plaintext\"><\/code><\/p>\n<\/div>\n<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<ol>\n<li><strong>Sync cPanel Accounts<\/strong>:\n<ul>\n<li>Write a custom script on Server 1 to automatically create corresponding email accounts on Server 2 when a new cPanel account is created.<\/li>\n<li>Use the WHM API or cPanel API to trigger account creation on both servers.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>Step 4: Configure Remote Mail Exchanger<\/h3>\n<ol>\n<li><strong>Set Email Routing<\/strong>:\n<ul>\n<li>On Server 1, ensure that the default email routing is set to <code>Remote Mail Exchanger<\/code> for all new accounts.<\/li>\n<li>Go to <code>WHM -&gt; Server Configuration -&gt; Tweak Settings<\/code> and set <code>Mail routing<\/code> to <code>Remote<\/code>.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>Step 5: Custom Scripts for Account Creation<\/h3>\n<ol>\n<li>\n<p><strong>Create Custom Hook Script<\/strong>:<\/p>\n<ul>\n<li>Create a custom hook script in <code>\/scripts\/postwwwacct<\/code> on Server 1.<\/li>\n<li>This script should use the WHM API to create a corresponding email account on Server 2 whenever a new cPanel account is created on Server 1.<\/li>\n<\/ul>\n<p>Example of a simple postwwwacct script:<\/p>\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md\">\n<div class=\"flex items-center\"><\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4 text-left undefined\" dir=\"ltr\">\n<p>#!\/bin\/bash<br \/>DOMAIN=$1<br \/>USER=$2<\/p>\n<p># WHM API call to create email account on Server 2<br \/>ssh root@server2 &#8220;\/scripts\/create_email_account.sh $USER $DOMAIN&#8221;<\/p>\n<\/div>\n<div class=\"overflow-y-auto p-4 text-left undefined\" dir=\"ltr\">\n<p><code class=\"!whitespace-pre hljs language-bash\"><\/code><\/p>\n<p><strong style=\"font-size: 14px;\">Email Account Creation Script on Server 2<\/strong><span style=\"font-size: 14px;\">:<\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<ul>\n<li>Create a script <code>\/scripts\/create_email_account.sh<\/code> on Server 2 that handles the creation of email accounts.<\/li>\n<li>Example:\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"overflow-y-auto p-4 text-left undefined\" dir=\"ltr\">\n<p>#!\/bin\/bash<br \/>USER=$1<br \/>DOMAIN=$2<\/p>\n<p>\/usr\/local\/cpanel\/bin\/createacct $USER $DOMAIN<\/p>\n<p><span style=\"font-size: 14px;\"><\/span><\/p>\n<\/div>\n<div class=\"overflow-y-auto p-4 text-left undefined\" dir=\"ltr\">\n<p><code class=\"!whitespace-pre hljs language-bash\"><span class=\"hljs-variable\"><\/span><\/code><\/p>\n<\/div>\n<div class=\"overflow-y-auto p-4 text-left undefined\" dir=\"ltr\">\n<p><code class=\"!whitespace-pre hljs language-bash\"><\/code><\/p>\n<p><code class=\"!whitespace-pre hljs language-bash\"><\/p>\n<p><\/code><\/p>\n<p><code class=\"!whitespace-pre hljs language-bash\"><\/code><\/p>\n<p><code class=\"!whitespace-pre hljs language-bash\"><\/code><\/p>\n<\/div>\n<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>Step 6: Test the Setup<\/h3>\n<ol>\n<li><strong>Create a New cPanel Account<\/strong>:\n<ul>\n<li>On Server 1, create a new cPanel account and verify that the email account is automatically created on Server 2.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Verify Email Routing<\/strong>:\n<ul>\n<li>Ensure that emails sent to the new domain are correctly routed to Server 2.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>Step 7: Monitor and Troubleshoot<\/h3>\n<ol>\n<li><strong>Logs and Monitoring<\/strong>:\n<ul>\n<li>Monitor the logs on both servers to ensure proper synchronization and troubleshoot any issues that arise.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>By following these steps, you can set up a system where email accounts are automatically created on a separate mail server whenever a new cPanel account is created on your main server. If you need more detailed guidance on any specific step, feel free to ask!<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.23&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_row _builder_version=&#8221;4.23&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.23&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.24.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;] In today\u2019s digital landscape, efficiently managing your web and email hosting can significantly enhance your server performance and security. If you\u2019re using WHM\/cPanel and looking to streamline your hosting setup, separating your web and email hosting onto different servers is [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":1318,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[198,2],"tags":[119,203],"class_list":["post-1323","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-email","category-hosting-marketers-news","tag-cpanel","tag-emailserver"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2024\/05\/DALL%C2%B7E-2024-05-28-07.48.22-A-sleek-modern-data-center-with-two-distinct-server-racks-labeled-Web-Hosting-and-Email-Hosting.-The-Web-Hosting-rack-is-connected-to-a-cPanel-.webp?fit=1792%2C1024&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p9Yxzd-ll","jetpack-related-posts":[{"id":1367,"url":"https:\/\/hosting-marketers.com\/news\/2025\/04\/15\/12-essential-steps-to-secure-your-laravel-website-on-cpanel\/","url_meta":{"origin":1323,"position":0},"title":"12 Essential Steps to Secure Your Laravel Website on cPanel","author":"Admin","date":"April 15, 2025","format":false,"excerpt":"Laravel is a powerful and flexible PHP framework \u2014 but with that power comes responsibility. If you're running your Laravel application on a cPanel server, securing your environment is critical. At Hosting Marketers, we use LiteSpeed, CloudLinux, CPGuard, and Cloudflare, providing a robust foundation \u2014 but the app itself must\u2026","rel":"","context":"In &quot;security&quot;","block_context":{"text":"security","link":"https:\/\/hosting-marketers.com\/news\/category\/security\/"},"img":{"alt_text":"Laravel security is not optional \u2014 and at Hosting Marketers, we make sure you start with the best protection possible. By combining strong server-level firewalls with smart application-level hardening, your Laravel website can stay one step ahead of hackers.","src":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_15_08-AM.png?fit=800%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_15_08-AM.png?fit=800%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_15_08-AM.png?fit=800%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_15_08-AM.png?fit=800%2C1200&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1141,"url":"https:\/\/hosting-marketers.com\/news\/2022\/08\/27\/node-js-creating-an-application-on-our-cpanel-application-manager\/","url_meta":{"origin":1323,"position":1},"title":"Node JS: Creating an Application on our CPANEL Application Manager","author":"Admin","date":"August 27, 2022","format":false,"excerpt":"Creating an Application in the cPanel Application Manager Hosting applications with cPanel is a two-step process: Install the app on the server.\u00c2\u00a0Register it with\u00c2\u00a0the Application Manager. We\u00e2\u20ac\u2122ll look at registering an application in the next section, but first, we need to install it on the server. Users of the Git\u00e2\u201e\u00a2\u2026","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":521,"url":"https:\/\/hosting-marketers.com\/news\/2015\/05\/06\/what-is-disk-io-usage-and-why-on-my-cpanel-it-shows-it-in-full-red\/","url_meta":{"origin":1323,"position":2},"title":"what is Disk I\/O Usage and why on my cpanel it shows it in full red?","author":"Admin","date":"May 6, 2015","format":false,"excerpt":"I\/O (input\/output defined as KB\/s) is just the \"throughput\" or speed of data transfer between the hard disk and the RAM. On a server, a disk I\/O describes every process that involves writing to or reading from a storage device which on a shared web hosting server will be the\u2026","rel":"","context":"In &quot;Disk I\/O Usage&quot;","block_context":{"text":"Disk I\/O Usage","link":"https:\/\/hosting-marketers.com\/news\/category\/disk-io-usage\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1371,"url":"https:\/\/hosting-marketers.com\/news\/2025\/04\/15\/the-ultimate-wordpress-security-guide-for-cpanel-users-2025-edition\/","url_meta":{"origin":1323,"position":3},"title":"The Ultimate WordPress Security Guide for cPanel Users (2025 Edition)","author":"Admin","date":"April 15, 2025","format":false,"excerpt":"WordPress powers over 40% of all websites \u2014 which makes it a prime target for hackers. If you\u2019re hosting with cPanel and using WordPress, security should be your top priority. At Hosting Marketers, we give you the tools (LiteSpeed, CloudLinux, CPGuard, Cloudflare) \u2014 but here\u2019s what you need to do\u2026","rel":"","context":"In &quot;security&quot;","block_context":{"text":"security","link":"https:\/\/hosting-marketers.com\/news\/category\/security\/"},"img":{"alt_text":"Protect your WordPress site from hackers with this complete security guide. Learn how to harden your site using cPanel, PHP updates, file permissions, .htaccess rules, and best practices.","src":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_36_03-AM.png?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_36_03-AM.png?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_36_03-AM.png?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_36_03-AM.png?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-15-2025-06_36_03-AM.png?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":162,"url":"https:\/\/hosting-marketers.com\/news\/2010\/02\/13\/how-to-install-the-latest-ffmpeg-mplayer-mencoder-ffmpeg-php-on-centos-server\/","url_meta":{"origin":1323,"position":4},"title":"How To Install FFmpeg, Mplayer, Mencoder, FFmpeg-PHP on a CentOS server","author":"Admin","date":"February 13, 2010","format":false,"excerpt":"I tried first to use the installer of ScriptMantra but for some reason there were errors sometimes the Liba52, sometimes the Mplayer were not installed, so I just gave up and used the autoinstaller just to remove all traces of ffmpeg on the server, then I used the yum to\u2026","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":791,"url":"https:\/\/hosting-marketers.com\/news\/2019\/06\/29\/dmarc-cpanel-how-to-setup-dmarc-on-cpanel\/","url_meta":{"origin":1323,"position":5},"title":"DMARC cPanel | How to setup DMARC on cpanel","author":"Admin","date":"June 29, 2019","format":false,"excerpt":"how to set up a dmarc on the cpanel","rel":"","context":"In &quot;DMARC CPANEL&quot;","block_context":{"text":"DMARC CPANEL","link":"https:\/\/hosting-marketers.com\/news\/category\/dmarc-cpanel\/"},"img":{"alt_text":"DMARC CPANEL","src":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/06\/add-record-dns.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/06\/add-record-dns.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/06\/add-record-dns.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/06\/add-record-dns.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/hosting-marketers.com\/news\/wp-content\/uploads\/2019\/06\/add-record-dns.png?resize=1050%2C600&ssl=1 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/1323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/comments?post=1323"}],"version-history":[{"count":3,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/1323\/revisions"}],"predecessor-version":[{"id":1328,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/1323\/revisions\/1328"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/media\/1318"}],"wp:attachment":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/media?parent=1323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/categories?post=1323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/tags?post=1323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}