{"id":349,"date":"2010-07-08T00:34:42","date_gmt":"2010-07-08T06:34:42","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=349"},"modified":"2026-03-25T04:05:55","modified_gmt":"2026-03-25T10:05:55","slug":"how-to-change-exims-outgoing-mail-ip-2","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/how-to-change-exims-outgoing-mail-ip-2\/","title":{"rendered":"How to Change the Outgoing SMTP IP Address in Exim | Step-by-Step Guide"},"content":{"rendered":"\n<p>When a server\u2019s primary IP address becomes blacklisted, outgoing emails may:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Bounce immediately<\/li>\n\n\n\n<li>Fail to deliver<\/li>\n\n\n\n<li>Land in spam folders<\/li>\n\n\n\n<li>Be rejected with reputation errors<\/li>\n<\/ul>\n\n\n\n<p>If your server uses <strong>Exim<\/strong> as its mail transfer agent (MTA), you can temporarily restore email delivery by configuring Exim to send mail from an alternate IP address.<\/p>\n\n\n\n<p>This guide explains how to safely change the outgoing SMTP IP in Exim, verify the configuration, and avoid common deliverability mistakes.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Why an IP Gets Blacklisted<\/h1>\n\n\n\n<p>Before switching IPs, understand the root cause.<\/p>\n\n\n\n<p>Common reasons include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Compromised email accounts sending spam<\/li>\n\n\n\n<li>Infected websites sending bulk mail<\/li>\n\n\n\n<li>Poor outbound rate limiting<\/li>\n\n\n\n<li>Missing SPF, DKIM, or DMARC<\/li>\n\n\n\n<li>Misconfigured scripts or contact forms<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>Changing the outgoing IP is a <strong>temporary workaround<\/strong>.<br>The underlying issue must still be investigated and fixed.<\/em><\/p>\n<\/blockquote>\n\n\n\n<h1 class=\"wp-block-heading\">Step 1: Confirm the IP Is Actually Blacklisted<\/h1>\n\n\n\n<p>Before modifying configuration:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check mail logs:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>grep rejected \/var\/log\/exim_mainlog<\/code><\/pre>\n\n\n\n<p>Look for reputation or blacklist errors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check blacklist status using:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>MXToolbox<\/li>\n\n\n\n<li>Spamhaus<\/li>\n\n\n\n<li>Barracuda reputation check<\/li>\n<\/ul>\n\n\n\n<p>If the IP appears listed, proceed with switching to a secondary IP.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Step 2: Stop the Exim Service<\/h1>\n\n\n\n<p>Stop the service before editing configuration files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service exim stop<\/code><\/pre>\n\n\n\n<p>or:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl stop exim<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Step 3: Edit the Exim Configuration File<\/h1>\n\n\n\n<p>Open the configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/exim.conf<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Step 4: Locate the <code>remote_smtp<\/code> Transport<\/h1>\n\n\n\n<p>Inside the file, search for:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>remote_smtp<\/code><\/pre>\n\n\n\n<p>This section controls how outgoing mail is delivered to external mail servers.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Step 5: Specify the New Outgoing IP<\/h1>\n\n\n\n<p>Inside the <code>remote_smtp<\/code> section:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Remove or comment out any existing:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>interface =<br>helo_data =<\/code><\/pre>\n\n\n\n<p>Then add:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>interface = NEW.IP.ADDRESS.HERE<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Example:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>remote_smtp:<br>  driver = smtp<br>  interface = 192.0.2.25<\/code><\/pre>\n\n\n\n<p>This forces Exim to bind outgoing SMTP connections to the specified IP.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Step 6: Save and Exit<\/h1>\n\n\n\n<p>In <code>vi<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ESC \u2192 :wq \u2192 Enter<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Step 7: Restart Exim<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>service exim restart<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart exim<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Step 8: Configure Reverse DNS (Critical)<\/h1>\n\n\n\n<p>After switching IPs, ensure the new IP has:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A valid PTR (reverse DNS) record<\/li>\n\n\n\n<li>PTR pointing to a fully qualified domain name<\/li>\n\n\n\n<li>Forward-confirmed reverse DNS (FCRDNS)<\/li>\n<\/ul>\n\n\n\n<p>Major providers such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Google<\/li>\n\n\n\n<li>Microsoft<\/li>\n\n\n\n<li>Yahoo<\/li>\n<\/ul>\n\n\n\n<p>may reject mail without proper rDNS.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Step 9: Update SPF Record (Very Important)<\/h1>\n\n\n\n<p>If you change the sending IP, you must update your domain\u2019s SPF record.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>v=spf1 ip4:192.0.2.25 -all<\/code><\/pre>\n\n\n\n<p>Failing to update SPF will cause authentication failures and spam classification.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Control Panel Warning (cPanel \/ DirectAdmin)<\/h1>\n\n\n\n<p>If your server runs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>cPanel<\/li>\n\n\n\n<li>DirectAdmin<\/li>\n<\/ul>\n\n\n\n<p>Do NOT directly modify <code>\/etc\/exim.conf<\/code>.<\/p>\n\n\n\n<p>These systems auto-generate the configuration.<\/p>\n\n\n\n<p>Instead:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the Exim Configuration Manager in WHM (cPanel)<\/li>\n\n\n\n<li>Or modify custom transport templates in DirectAdmin<\/li>\n<\/ul>\n\n\n\n<p>Using <code>chattr +ia<\/code> on managed servers may break updates.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">How to Verify the New IP Is Being Used?<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Check Logs<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -f \/var\/log\/exim_mainlog<\/code><\/pre>\n\n\n\n<p>Look for outbound connections using the new IP.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Send a Test Email<\/h2>\n\n\n\n<p>Send an email to Gmail or Outlook.<\/p>\n\n\n\n<p>Then inspect the <strong>Received headers<\/strong> and confirm the sending IP matches your configured address.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Common Mistakes to Avoid<\/h1>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Forgetting SPF update<\/li>\n\n\n\n<li>Not setting reverse DNS<\/li>\n\n\n\n<li>Multiple IPs defined in firewall rules<\/li>\n\n\n\n<li>Leaving compromised accounts active<\/li>\n\n\n\n<li>Locking config with <code>chattr<\/code> on managed servers<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">Best Practices for Long-Term Deliverability<\/h1>\n\n\n\n<p>Switching IPs should not be permanent.<\/p>\n\n\n\n<p>You should:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Audit outbound mail volume<\/li>\n\n\n\n<li>Enable SMTP authentication rate limits<\/li>\n\n\n\n<li>Scan for malware<\/li>\n\n\n\n<li>Enable DKIM signing<\/li>\n\n\n\n<li>Configure DMARC policy<\/li>\n\n\n\n<li>Monitor IP reputation continuously<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">FAQs<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Will this affect incoming mail?<\/h2>\n\n\n\n<p>No. This change only affects outbound SMTP connections.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Can I use multiple outgoing IPs?<\/h2>\n\n\n\n<p>Yes, but that requires advanced transport configuration or IP rotation logic.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Do I need to change DKIM?<\/h2>\n\n\n\n<p>No. DKIM signing is domain-based and does not depend on IP.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Is this safe on shared hosting servers?<\/h2>\n\n\n\n<p>Only if you understand the mail flow. On shared hosting, control panel configuration must be respected.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Conclusion<\/h1>\n\n\n\n<p>When a server\u2019s primary IP becomes blacklisted, configuring Exim to use an alternate outgoing IP can quickly restore email functionality.<\/p>\n\n\n\n<p>However:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Proper rDNS is mandatory<\/li>\n\n\n\n<li>SPF must be updated<\/li>\n\n\n\n<li>Root causes must be investigated<\/li>\n<\/ul>\n\n\n\n<p>Treat IP switching as a temporary recovery measure \u2014 not a permanent solution.<\/p>\n\n\n\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n\n\n\n<p class=\"has-text-align-center\"><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><\/a><\/span><\/span><\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Facing issues? <\/p>\n\n\n\n<p class=\"has-large-font-size\">Our technical support<br>engineers can solve it. <\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>When a server\u2019s primary IP address becomes blacklisted, outgoing emails may: If your server uses Exim as its mail transfer agent (MTA), you can temporarily restore email delivery by configuring&hellip;<\/p>\n","protected":false},"author":4,"featured_media":15613,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[5,1],"tags":[],"class_list":["post-349","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general-topics","category-miscellaneous"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=349"}],"version-history":[{"count":9,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/349\/revisions"}],"predecessor-version":[{"id":16577,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/349\/revisions\/16577"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media\/15613"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}