Formats for /etc/mailhelo and /etc/mailips

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.
  • 5 Users Found This Useful
這篇文章有幫助嗎?

相關文章

How To: Back Up MySQL Databases From The Command Line

While automated backups are important, sometimes you just want to take a quick and dirty snapshot...

How To Install MariaDB on CentOS 6

MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and...

How to Display (List) All Jobs in Cron / Crontab

View Root’s Cron Jobs crontab -l  View a User’s Cron Jobs crontab -u username -l Example with...

How To: Automate Server Scripts With Cron

Servers can automatically perform tasks that you would otherwise have to perform yourself, such...

How to find sending spam emails and enable mail header in php.ini

- In Linux servers if there are a lot of emails in the queue "over 100" emails. you can check if...