Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
UAPI Functions - EmailAuth::get_mail_helo_ip - Developer Documentation - cPanel Documentation
Child pages
  • UAPI Functions - EmailAuth::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 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.

Important:

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

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/get_mail_helo_ip?domain=example.com&domain=anotherexample.com


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$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'
  )
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
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'
  }
);


Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
<!-- 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' } ) %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

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


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
   "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
  }
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel 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
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