Formats for /etc/mailhelo, mailips, etc.

nyjimbo

Well-Known Member
Jan 25, 2003
1,135
1
168
New York
I have to change how mail is sent from one of our machines because it is on a network with a poor reputation. I have additional ips and can switch the sending ip to something else.

When I look at the options in EXIM CONFIGURATION I see:

** Send HELO based on the domain name in /etc/mailhelo (*: HELONAME can be added to the file to change the default helo name) [?]
Send HELO based on the domain name in /etc/mailhelo (*: HELONAME can be added to the file to change the default helo name)


** Send outgoing mail from the ip that matches the domain name in /etc/mailips (*: IP can be added to the file to change the main outgoing interface) [?]
Send outgoing mail from the ip that matches the domain name in /etc/mailips (*: IP can be added to the file to change the main outgoing interface)


** Automaticlly send outgoing mail from the account's IP address instead of the main IP address. Warning: If you turn this setting on you should make sure reverse DNS entries match the ones in /etc/mail_reverse_dns. [?]
Automaticlly send outgoing mail from the account's IP address instead of the main IP address.


How do I change the info for these files, all of them are currently empty except for /etc/mail_reverse_dns which has the main server ip and machine name. Do I just edit it manually with VI or PICO and it will work or will it be blown away with the next "upcp" ?.

What is the format for these three files ?.
 

Pablo Escobar

Registered
Mar 21, 2009
4
0
51
Bump for an answer to the above post?

The manual has no format info of what needs to be in these files.

Thanks

A sample file would do as well.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Hello,

You may use any command-line text editor such as vi (or vim), nano (or pico), to edit the files. As long as the automatic option is not in use you can manually update and manage the mailhelo and mailips files without them being overwritten.

The easiest method to see a full version of the files with proper syntax is to temporarily enable the following "automatic" option:
WHM: Main >> Service Configuration >> Exim Configuration Editor >> Standard Options >> Domains and IPs
* Automatically send outgoing mail from the account's IP address instead of the main IP address. Warning: If you turn this setting on you should make sure reverse DNS entries match the ones in /etc/mail_reverse_dns

The above option will create the files so you can simply view their contents to see how they are used.

Alternatively, you can manually create them based off the following examples, while being sure to use your own domains and IP addresses where applicable; however, please note that to retain customizations of the two files, mailhelo and mailips, it is necessary to enable the relevant options via the Exim Configuration Editor in WHM as seen below.

WHM: Main >> Service Configuration >> Exim Configuration Editor >> Standard Options >> Domains and IPs
* Send HELO based on the domain name in /etc/mailhelo (*: HELONAME can be added to the file to change the default helo name)
* Send outgoing mail from the ip that matches the domain name in /etc/mailips (*: IP can be added to the file to change the main outgoing interface)

Full Path: "/etc/mailhelo"
Code:
domain2.tld: domain2.tld
sub.domain2.tld: domain2.tld
addondomain.tld: domain2.tld
other.domain3.tld: other.domain3.tld
*: server1.domain1.tld
In mailhelo, the example entry that begins with an asterisk sets the default HELO for domains without their own specific entry; you could, if desired, just have the default set and nothing else.

The "#.#.#.#" entries in the following two examples are meant to represent IP addresses on your system; be sure to use only valid, public IP addresses that are accessible via the Internet.

Full Path: "/etc/mailips"
Code:
domain2.tld: #.#.#.2
sub.domain2.tld: #.#.#.2
addondomain.tld: #.#.#.2
other.domain3.tld: #.#.#.3
*: #.#.#.1
In mailips, the example entry that begins with an asterisk sets the default outbound (sending) IP address for domains without their own specific entry; you could, if desired, just have the default set and nothing else.

You should not have to manually edit or manage the mail_reverse_dns file; the only two that you would manually edit are mailhelo and mailips. For the sake of showing an example, though, here is what the mail_reverse_dns file might look like:

Full Path: "/etc/mail_reverse_dns"
Code:
#.#.#.1: server1.domain1.tld
#.#.#.2: domain2.tld
#.#.#.3: other.domain3.tld
To help understand why the above examples look the way they do, in terms of why a particular domain has a specific HELO value and or why a particular domain has a specific outbound IP, and to help show what you might expect to see from the aforementioned "automatic" option, the following could be assumed:
1.) "domain2.tld" is a primary domain
2.) "sub.domain2.tld" is a sub-domain of "domain2.tld"
3.) "addondomain.tld" is an add-on domain of "domain2.tld"
4.) "other.domain3.tld" is a also primary domain
5.) "server1.domain1.tld" is the server hostname

If you opt to manually create, update and manage the mailhelo and mailips files, you are free to customize them as needed provided they contain the correct syntax and use only valid domains and IP addresses.
 
Last edited:

Pablo Escobar

Registered
Mar 21, 2009
4
0
51
Thannks, That was an excellent treastise and should be just copy and pasted into the manual.

I'll try these out later this afternoon.

Why doesn't exim create the data for these files in the first place? Seems like the information already "exists" in the domain setups...

And to help me better understand the current behavior, when the files are empty, the information exim posts to a helo query when these are checked and the resultant error message is...

mail.domain1.com claims to be host server1.domain.com [but that host is at xx.xxx.xxx.52 (may be cached), not xx.xxx.xxx.94]. <br />

with the changes to the two files, then this type of message would be "fixed". right?
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Why doesn't exim create the data for these files in the first place? Seems like the information already "exists" in the domain setups...
The mailhelo and mailips files are only needed if you desire customization of HELO responses from Exim and to override the stock-default behavior of Exim using the main server IP address. If you opt to -not-use- the "automatic" option then you must manually create and manage the two (mailhelo and mailips) files. Conversely, if you opt to -use- the "automatic" option then cPanel will create and manage both files for you based upon the IP address of each account.

And to help me better understand the current behavior, when the files are empty, the information exim posts to a helo query when these are checked and the resultant error message is...

mail.domain1.com claims to be host server1.domain.com [but that host is at xx.xxx.xxx.52 (may be cached), not xx.xxx.xxx.94].

with the changes to the two files, then this type of message would be "fixed". right?
The message alone usually does not indicate a fatal error, but whether or not the receiving mail server rejects an e-mail for that depends on how the recipient mail system is configured to handle the specific circumstances involved. Normally the warning is safe to ignore, and to the best of my knowledge it is usually only shown by online tools that check for possible DNS issues.

The message should only appear if an account is on an IP address different than your main server IP address, or more specifically, different than the default interface's IP address that you have Exim configured to use; however, as certain third-party mail server configurations might be more strict, to help ensure this scenario does not become a problem for you, or if you need to correct it, we have the functionality there for you to easily customize (Exim) as your needs require.
 
Last edited:

big

Well-Known Member
Aug 12, 2001
224
0
316
Earth
why updated exim configurator doesn't automatically build these files ?

or there is a script to run todo so?
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
why updated exim configurator doesn't automatically build these files ?

or there is a script to run todo so?
Via root SSH access, please let us know the output from the following commands:
Code:
# grep "mailhelo\|mailips" /etc/exim.conf.localopts
# stat /var/cpanel/custom_mailhelo /var/cpanel/custom_mailips
To the best of my knowledge the following script would be the one that triggers an update of the files but only if circumstances are appropriate (i.e., not when the files are managed manually):
Code:
# /scripts/updateuserdomains
 

Ralph9110

Member
Dec 7, 2006
16
0
151
Have you found that this works for you?

We have found that this does not work at all!

The HELO is still seen as the hostname, even though we have the domains listed in /etc/mailhelo
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Have you found that this works for you?

We have found that this does not work at all!

The HELO is still seen as the hostname, even though we have the domains listed in /etc/mailhelo
If a bug is suspected please note that the best avenue to report it is via our ticket system, such as by using the link in the top-right corner of the forums, labeled Bugs; using this method helps to ensure greater efficiency, accuracy in diagnosis, full and in-depth investigation and faster resolution.

When available, please send me a private message (PM) including your new ticket ID number so that I may follow-up internally.
 
Thread starter Similar threads Forum Replies Date
R Email 1
D Email 3
W Email 3
N Email 4
T Email 2