{"id":3521,"date":"2009-05-27T19:37:15","date_gmt":"2009-05-27T23:37:15","guid":{"rendered":"http:\/\/underhost.com\/blog\/?p=3521"},"modified":"2025-03-07T08:27:10","modified_gmt":"2025-03-07T13:27:10","slug":"how-to-change-cpanel-mail-server-ip-address","status":"publish","type":"post","link":"https:\/\/underhost.com\/blog\/how-to-change-cpanel-mail-server-ip-address\/","title":{"rendered":"Updated MARCH 2025: Changing the Outgoing Email IP in cPanel\/Exim"},"content":{"rendered":"<h2><strong>Why Change the Outgoing Email IP in Exim?<\/strong><\/h2>\n<p>\nSometimes, your server\u2019s primary IP address gets blacklisted by spam monitoring services (RBLs), causing email deliverability issues.\n<\/p>\n<p>\nIf this happens, a quick solution is to <strong>route outgoing emails through a secondary IP<\/strong> that is not blacklisted. Exim, the default mail server in cPanel, allows you to configure a new IP for outgoing emails.\n<\/p>\n<p>\nFor a more detailed step-by-step guide, check out our updated tutorial:<br \/>\n<a href=\"https:\/\/underhost.com\/blog\/changing-the-outgoing-email-ip-in-cpanel-exim-step-by-step-guide\/\">Changing the Outgoing Email IP in cPanel\/Exim<\/a>.\n<\/p>\n<h2><strong>Quick Steps to Change the Outgoing Email IP<\/strong><\/h2>\n<h3><strong>Step 1: Stop the Exim Service<\/strong><\/h3>\n<pre>\r\nservice exim stop\r\n[OR]\r\n\/etc\/init.d\/exim stop\r\n<\/pre>\n<h3><strong>Step 2: Edit the Exim Configuration File<\/strong><\/h3>\n<p>\nOpen the Exim configuration file for editing:\n<\/p>\n<pre>\r\nvi \/etc\/exim.conf\r\n<\/pre>\n<h3><strong>Step 3: Modify the &#8220;remote_smtp&#8221; Section<\/strong><\/h3>\n<p>\nFind the section under **TRANSPORTS CONFIGURATION** labeled <code>remote_smtp<\/code>.\n<\/p>\n<p>\nBy default, it looks like this:\n<\/p>\n<pre>\r\nremote_smtp:\r\n  driver = smtp\r\n  interface = ${if exists {\/etc\/mailips}{${lookup{$sender_address_domain}lsearch{\/etc\/mailips}{$value}{}}}{}}\r\n  helo_data = ${if exists {\/etc\/mailhelo}{${lookup{$sender_address_domain}lsearch{\/etc\/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}\r\n<\/pre>\n<h3><strong>Step 4: Update the Outgoing IP Address<\/strong><\/h3>\n<p>\nRemove or comment out the <code>interface<\/code> and <code>helo_data<\/code> lines, then replace them with your new IP address:\n<\/p>\n<pre>\r\nremote_smtp:\r\n  driver = smtp\r\n  interface = 12.12.12.12  # Replace with your new IP\r\n<\/pre>\n<h3><strong>Step 5: Save the Configuration and Set Read-Only Mode<\/strong><\/h3>\n<p>\nTo prevent cPanel from overwriting your changes, set the configuration file as read-only:\n<\/p>\n<pre>\r\nchattr +aui \/etc\/exim.conf\r\n<\/pre>\n<h3><strong>Step 6: Restart Exim<\/strong><\/h3>\n<pre>\r\nservice exim restart\r\n[OR]\r\n\/etc\/init.d\/exim restart\r\n<\/pre>\n<h3><strong>Step 7: Set Reverse DNS (PTR Record)<\/strong><\/h3>\n<p>\nEnsure that the new IP address has a valid reverse DNS (PTR) record pointing to a Fully Qualified Domain Name (FQDN). This is required to avoid email rejection by receiving mail servers.\n<\/p>\n<h3><strong>Step 8: Test and Verify<\/strong><\/h3>\n<p>\nSend a test email and check the email headers to confirm that it is using the new IP address. You can also verify it in the Exim log:\n<\/p>\n<pre>\r\ntail -f \/var\/log\/exim_mainlog\r\n<\/pre>\n<h2><strong>Get Expert Email Hosting with UnderHost<\/strong><\/h2>\n<p>\nHaving trouble with email deliverability? Upgrade to a <a href=\"https:\/\/underhost.com\/cloud-vps.php\">Cloud VPS<\/a> or <a href=\"https:\/\/underhost.com\/dedicated-servers-offshore.php\">Dedicated Server<\/a> with advanced email routing options and full SMTP customization.\n<\/p>\n<p>\nNeed help? Contact <a href=\"https:\/\/customerpanel.ca\/client\">UnderHost Support<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Is your server\u2019s IP blacklisted? Learn how to configure Exim in cPanel to send emails through a different IP address to avoid blacklisting issues.<\/p>\n","protected":false},"author":1,"featured_media":5009,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,11],"tags":[],"class_list":["post-3521","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-controlpanel","category-how-to"],"_links":{"self":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/3521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/comments?post=3521"}],"version-history":[{"count":3,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/3521\/revisions"}],"predecessor-version":[{"id":5099,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/3521\/revisions\/5099"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/media\/5009"}],"wp:attachment":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/media?parent=3521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/categories?post=3521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/tags?post=3521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}