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 in 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.

Examples




https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/get_mail_helo_ip?domain=example.com&domain=anotherexample.com



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Fetch the HELO name and IP address this server uses when it sends mail for the given domain.
$poll = $cpanel->uapi(
    'EmailAuth', 'get_mail_helo_ip',
    array(
        'domain' => 'example.com',
		'domain' => 'anotherexample.com'
  )
);



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Fetch the HELO name and IP address this server uses when it sends mail for the given domain.
my $poll = $cpliveapi->uapi(
    'EmailAuth', 'get_mail_helo_ip',
    {
        'domain' => 'example.com',
		'domain' => 'anotherexample.com'
  }
);



<!-- Fetch the HELO name and IP address this server uses when it sends mail for the given domain. -->
[% execute( 'EmailAuth', 'get_mail_helo_ip', { 'domain' => 'example.com', 'domain' => 'anotherexample.com' } ) %]



uapi --user=username EmailAuth get_mail_helo_ip domain=example.com domain=anotherexample.com



{
   "apiversion": 3,
   "module": "EmailAuth",
   "func": "get_mail_helo_ip",
   "result": {
      "data": [
        {
            "domain": "example.com",
            "helo": "example.com",
            "public_ip": "10.0.0.1"
        },
		{
			"domain": "anotherexample.com",
			"helo": "hostname.example.com",
			"public_ip": "10.0.0.1"
		}
    ],
  "errors": null,
  "messages": null,
  "metadata": {
      "transformed": 1
          },
  "status": 1,
  "warnings": null
  }
}



Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

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

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
dataarray 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 data 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 data 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 data array.

A valid string.

10.0.0.1