{"id":660,"date":"2024-12-13T12:13:47","date_gmt":"2024-12-13T12:13:47","guid":{"rendered":"https:\/\/249host.com\/tutorials\/?p=660"},"modified":"2024-12-13T12:14:23","modified_gmt":"2024-12-13T12:14:23","slug":"how-to-whitelist-an-ip-address-in-exim","status":"publish","type":"post","link":"https:\/\/249host.com\/tutorials\/how-to-whitelist-an-ip-address-in-exim\/","title":{"rendered":"How to whitelist an IP address in Exim"},"content":{"rendered":"<p>To whitelist an IP address in Exim, you can modify its configuration to allow connections from a specific IP address without restrictions.<\/p>\n<p>Exim is a powerful and flexible mail transfer agent (MTA) used on Unix-like operating systems. It&#8217;s highly configurable and widely used for sending, receiving, and routing <a href=\"https:\/\/www.squarebrothers.com\/email-hosting-india\/\" target=\"_blank\" rel=\"noopener\">emails<\/a>.<\/p>\n<p>Here\u2019s how you can do it:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-668 size-full aligncenter\" src=\"https:\/\/249host.com\/tutorials\/wp-content\/uploads\/2024\/12\/Exim-manager.png\" alt=\"whitelist an IP address in Exim\" width=\"591\" height=\"315\" srcset=\"https:\/\/249host.com\/tutorials\/wp-content\/uploads\/2024\/12\/Exim-manager.png 591w, https:\/\/249host.com\/tutorials\/wp-content\/uploads\/2024\/12\/Exim-manager-300x160.png 300w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><\/p>\n<h3><strong>Step 1: Edit Exim Configuration<\/strong><\/h3>\n<ol>\n<li>Locate the Exim configuration file, usually found at:\n<ul>\n<li><code>\/etc\/exim\/exim.conf<\/code><\/li>\n<li><code>\/etc\/exim4\/exim4.conf.template<\/code> (Debian-based systems)<\/li>\n<li><code>\/etc\/exim.conf<\/code> (older installations)<\/li>\n<\/ul>\n<\/li>\n<li>Open the configuration file for editing with a text editor:<\/li>\n<\/ol>\n<pre>sudo nano \/etc\/exim\/exim.conf<\/pre>\n<h3><strong>Step 2: Add the Whitelisted IP<\/strong><\/h3>\n<p>You can whitelist an IP address in Exim using an <em>ACL (Access Control List)<\/em>.<\/p>\n<p>Locate the ACL section, which typically starts with:<\/p>\n<pre>begin acl<\/pre>\n<p>Look for the <code>acl_check_rcpt<\/code> section, which processes recipient restrictions.<\/p>\n<p>Add a condition at the top of <code>acl_check_rcpt<\/code> to accept the whitelisted IP. Example:<\/p>\n<pre>accept hosts = &lt;IP_ADDRESS&gt;<\/pre>\n<p>Replace <code>&lt;IP_ADDRESS&gt;<\/code> with the IP you want to whitelist. For example:<\/p>\n<pre>accept hosts = 192.168.1.100<\/pre>\n<h3><strong>Step 3: Restart Exim<\/strong><\/h3>\n<p>After saving the changes, restart Exim to apply the new configuration:<\/p>\n<pre>sudo systemctl restart exim<\/pre>\n<h3><strong>Optional: Use a File for IP Whitelisting<\/strong><\/h3>\n<p>If you have multiple IPs to whitelist, it\u2019s easier to manage them in a separate file.<\/p>\n<p>1.Create a whitelist file:<\/p>\n<pre>sudo nano \/etc\/exim\/whitelist_ips<\/pre>\n<p>2.Add the IP addresses (one per line):<\/p>\n<pre>192.168.1.100\r\n203.0.113.25<\/pre>\n<p>3.Modify the Exim configuration to reference this file:<\/p>\n<pre>accept hosts = +whitelist_ips<\/pre>\n<p>4.Add the whitelist to the <code>hosts<\/code> configuration:<\/p>\n<pre>hostlist whitelist_ips = \/etc\/exim\/whitelist_ips<\/pre>\n<p>Save and restart Exim:<\/p>\n<pre>sudo systemctl restart exim<\/pre>\n<h3><strong>Testing the Configuration<\/strong><\/h3>\n<p>Send a test email or attempt a connection from the whitelisted IP to confirm it\u2019s allowed.<\/p>\n<h3><strong>Troubleshooting<\/strong><\/h3>\n<ul>\n<li>Check Exim logs for errors:<\/li>\n<\/ul>\n<pre>sudo tail -f \/var\/log\/exim\/mainlog<\/pre>\n<ul>\n<li>Ensure the IP you added is correctly formatted.<\/li>\n<li>Verify no conflicting rules override the whitelist.<\/li>\n<\/ul>\n<p>I hope above article clarifies how to whitelist an IP address in Exim configuration.<\/p>\n<p>Let me know if you need further assistance!<\/p>\n<p>To know how to allow IP&#8217;s using host access control in WHM <a href=\"https:\/\/249host.com\/tutorials\/how-to-allow-ips-using-host-access-control\/\">click here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To whitelist an IP address in Exim, you can modify its configuration to allow connections from a specific IP address without restrictions. Exim is a powerful and flexible mail transfer agent (MTA) used on Unix-like operating systems. It&#8217;s highly configurable and widely used for sending, receiving, and routing emails. Here\u2019s how you can do it: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":668,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,10,1,11],"tags":[],"class_list":["post-660","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-control-panel","category-general","category-linux","category-security"],"_links":{"self":[{"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/posts\/660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/comments?post=660"}],"version-history":[{"count":8,"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/posts\/660\/revisions"}],"predecessor-version":[{"id":669,"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/posts\/660\/revisions\/669"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/media\/668"}],"wp:attachment":[{"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/media?parent=660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/categories?post=660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/249host.com\/tutorials\/wp-json\/wp\/v2\/tags?post=660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}