Question
How do I change the outgoing IP address for email?
Answer
Exim sends all mail from the server's primary IP address by default. You can configure it to send from a different IP for all accounts, or a different IP for each domain.
- Log in to WHM as the
rootuser. - Navigate to Exim Configuration Manager.
- Make sure the option Reference /etc/mailips for outgoing SMTP connections is enabled.
-
In SSH, edit the
/etc/mailipsfile and add the following line, replacing the IP with the address from which outbound messages for all accounts should be sent. If you are using a system behind a NAT configuration, make sure to enter the private IP address:CONFIG_TEXT: *: 10.0.0.15
You can also add an IPv6 address:
CONFIG_TEXT: *: ::1
If you have multiple IPs and would like to specify a different IP for some domains, you can do so by specifying a domain along with an IP instead of a wildcard:
CONFIG_TEXT: domain1.tld: 10.0.0.8
domain2.tld: 10.0.0.17
*: 10.0.0.15 -
If adding an IPv6 address, you will need to create the following touch file to have Exim prioritize the IPv6 networking device:
# touch /var/cpanel/exim_ipv6_sort_bias
For additional details and more customization options, see our documentation here:
Comments
0 comments
Article is closed for comments.