How to Edit the exim.conf File

Last modified: March 20, 2024


Overview

This document describes the final adjustments to change the IP address that Exim uses to send email.

Before you perform this procedure, you must follow the directions in our How to Configure the Exim Outgoing IP Address documentation.

Warning:

This document describes an unsupported workaround that is not guaranteed to work in the future.

  • After you perform these steps, it is the system administrator’s responsibility to manage and maintain the server’s database software.
  • We recommend that only experienced system administrators attempt to perform these steps.
  • WebPros International, LLC is not responsible for any data loss that this procedure may cause.

Edit the file

Warning:
  • Any edits that you make directly to the /etc/exim.conf file will only work temporarily.
  • Exim stores its default configuration in its override file, /etc/exim.conf.local. The system uses the /etc/exim.conf.local file to create the /etc/exim.conf file upon initialization.
  • You must use the Advanced Editor feature to make changes to your /etc/exim.conf.local file to make those changes permanent.

To edit the /etc/exim.conf file, perform the following steps:

  1. Open the /etc/exim.conf file with a text editor and locate the following lines:

    1
    2
    3
    4
    5
    6
    
    remote_smtp:
      driver = smtp
    
    dkim_remote_smtp:
      driver = smtp
      
    

  2. Below each driver = smtp line, add the following line:

connection_max_messages = 1

The file will resemble the following example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
remote_smtp:
driver = smtp
connection_max_messages = 1
interface = ${if exists {/etc/mailips}{${lookup{$original_domain}lsearch{/etc/ma
helo_data = ${if exists {/etc/mailhelo}{${lookup{$original_domain}lsearch{/etc/m

dkim_remote_smtp:
driver = smtp
connection_max_messages = 1
interface = ${if exists {/etc/mailips}{${lookup{$original_domain}lsearch{/etc/ma
helo_data = ${if exists {/etc/mailhelo}{${lookup{$original_domain}lsearch{/etc/m
dkim_domain = $sender_address_domain
dkim_selector = default
dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
dkim_canon = relaxed

Additional Documentation