Child pages
  • WHM API 1 Functions - get_mail_helo_ip
Skip to end of metadata
Go to start of metadata

Description

This function retrieves the HELO domain and IP address that the server uses when it sends a domain's mail. It retrieves this information from the /etc/mailhelo and /etc/mailips files. If the system cannot locate a HELO domain, this function returns the system's hostname. For more information, read our How to Configure the Exim Outgoing IP Address documentation.

Important:

When you disable the MailSend role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/get_mail_helo_ip?api.version=1&domain=example.com&domain=anotherexample.com
 Command Line
whmapi1 get_mail_helo_ip domain=example.com domain=anotherexample.com


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
   "data": {
      "records": [
        {
            "domain": "example.com",
            "helo": "example.com",
            "ip": "10.0.0.1"
        },
		{
			"domain": "anotherexample.com",
			"helo": "hostname.example.com",
			"ip": "10.0.0.1"
		}
    ],
  "metadata": {
     "command": "get_mail_helo_ip",
	 "reason": "OK",
	 "result": 1,
	 "version": 1
	}
  }
}


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain for which to retrieve the source IP address and the HELO domain information.

Note:

To query multiple domains, duplicate the parameter name. For example, use the domain=example.com, domain=example2.com, and domain=example3.com parameters.

A valid domain.example.com

Returns

ReturnTypeDescriptionPossible valuesExample
recordsarray of hashes

An array that contains information about a domain's HELO information.

Each hash contains the domain, helo, and public_ip returns.

                

domain

string

The queried domain.

This function returns this value in the records array.

A valid domain.

example.com

helo

string

The hostname that the domain uses to identify itself to remote SMTP servers.

This function returns this value in the records array.

A valid hostname.

example.com

public_ip

string

The IP address that the domain sends mail from.

This function returns this value in the records array.

A valid string.

10.0.0.1