Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function evaluates and validates an Exim configuration file's syntax.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/validate_exim_configuration_syntax?cfg_text=CONFIGURATIONFILE&section=acl
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/validate_exim_configuration_syntax?cfg_text=CONFIGURATIONFILE&section=acl
 Command Line
whmapi0 validate_exim_configuration_syntax cfg_text=CONFIGURATIONFILE section=acl

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 0 documentation or run the whmapi0 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
   "status":1,
   "rawout":"Exim version 4.76 #1 built 16-Aug-2011 11:41:07\nCopyright (c) University of Cambridge, 
1995 - 2007\nBerkeley DB: Sleepycat Software: Berkeley DB 4.3.29: (July 12, 2010)\nSupport for: 
crypteq iconv() IPv6 PAM Perl OpenSSL Content_Scanning DKIM Old_Demime Experimental_SPF 
Experimental_SRS\nLookups (built-in): lsearch wildlsearch nwildlsearch iplsearch dbm dbmnz passwd
\nAuthenticators: cram_md5 dovecot plaintext spa\nRouters: accept dnslookup ipliteral manualroute 
queryprogram redirect\nTransports: appendfile/maildir autoreply pipe smtp\nSize of off_t: 8\n\n"
}
 Output (XML)
<validate_exim_configuration_syntax>
    <rawout>
        Exim version 4.76 #1 built 16-Aug-2011 11:41:07 Copyright (c) University of Cambridge, 
1995 - 2007 Berkeley DB: Sleepycat Software: Berkeley DB 4.3.29: (July 12, 2010) Support for: 
crypteq iconv() IPv6 PAM Perl OpenSSL Content_Scanning DKIM Old_Demime Experimental_SPF 
Experimental_SRS Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch dbm dbmnz passwd 
Authenticators: cram_md5 dovecot plaintext spa Routers: accept dnslookup ipliteral manualroute 
queryprogram redirect Transports: appendfile/maildir autoreply pipe smtp Size of off_t: 8
        </rawout>
        <status>1</status>
</validate_exim_configuration_syntax>

   

Parameters

ParameterTypeDescriptionPossible valuesExample
cfg_text
string

The Exim configuration file's raw text.

If you do not use this parameter, the function will analyze Exim's current configuration.

An Exim configuration file.
 Click to view...
#!!# cPanel Exim 4 Config
hostlist loopback = <; 127.0.0.0/8 ; 0.0.0.0 ; ::1 ; 0000:0000:0000:0000:0000:ffff:7f00:0000/8
hostlist senderverifybypass_hosts = net-iplsearch;/etc/senderverifybypasshosts
hostlist skipsmtpcheck_hosts = net-iplsearch;/etc/skipsmtpcheckhosts
hostlist spammeripblocks = net-iplsearch;/etc/spammeripblocks
hostlist backupmx_hosts = lsearch;/etc/backupmxhosts
hostlist trustedmailhosts = lsearch;/etc/trustedmailhosts
hostlist relay_hosts = net-iplsearch;/etc/relayhosts
domainlist user_domains = ${if exists{/etc/userdomains} {lsearch;/etc/userdomains} fail}
smtp_accept_queue_per_connection = 30
remote_max_parallel = 10
smtp_receive_timeout = 165s
ignore_bounce_errors_after = 1d
rfc1413_query_timeout = 0s
timeout_frozen_after = 5d
auto_thaw = 7d
callout_domain_negative_expire = 1h
callout_negative_expire = 1h
acl_not_smtp = acl_not_smtp
acl_smtp_connect = acl_smtp_connect
acl_smtp_data = acl_smtp_data
acl_smtp_mail = acl_smtp_mail
acl_smtp_quit = acl_smtp_quit
acl_smtp_notquit = acl_smtp_notquit
acl_smtp_rcpt = acl_smtp_rcpt
message_body_newlines = true
perl_at_start = true
deliver_queue_load_max = 36
queue_only_load = 72
daemon_smtp_ports = 25 : 465 : 587
tls_on_connect_ports = 465
system_filter_user = cpaneleximfilter
system_filter_group = cpaneleximfilter
tls_require_ciphers = ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP
spamd_address = 127.0.0.1 783
# +incoming_port, +smtp_connection are needed for cPanel email tracking.
# -retry_defer, +subject, +arguments, +received_recipients are suggested settings that may be disabled.
log_selector = +incoming_port +smtp_connection -retry_defer +subject +arguments +received_recipients
system_filter = /etc/cpanel_exim_system_filter
 
#!!# These options specify the Access Control Lists (ACLs) that
#!!# are used for incoming SMTP messages - after the RCPT and DATA
#!!# commands, respectively.
 
#!!# This setting defines a named domain list called
#!!# local_domains, created from the old options that
#!!# referred to local domains. It will be referenced
#!!# later on by the syntax "+local_domains".
#!!# Other domain and host lists may follow.
 
domainlist local_domains = lsearch;/etc/localdomains
domainlist outside_jail_domains = lsearch;/etc/outside_jail_domains
 
domainlist relay_domains = lsearch;/etc/localdomains : \
     lsearch;/etc/secondarymx
hostlist auth_relay_hosts = *
 
######################################################################
#                  Runtime configuration file for Exim               #
######################################################################
 
# This is a default configuration file which will operate correctly in
# uncomplicated installations. Please see the manual for a complete list
# of all the runtime configuration options that can be included in a
# configuration file. There are many more than are mentioned here. The
# manual is in the file doc/spec.txt in the Exim distribution as a plain
# ASCII file. Other formats (PostScript, Texinfo, HTML) are available from
# the Exim ftp sites. The manual is also online via the Exim web sites.
 
 
# This file is divided into several parts, all but the last of which are
# terminated by a line containing the word "end". The parts must appear
# in the correct order, and all must be present (even if some of them are
# in fact empty). Blank lines, and lines starting with # are ignored.
 
######################################################################
#                    MAIN CONFIGURATION SETTINGS                     #
######################################################################
 
perl_startup = do '/etc/exim.pl'
.....
sectionstring

The Exim configuration file's section to check.

If you use this parameter, only pass the section to validate as the cfg_text value.

A valid Exim configuration file section name.

acl

Returns

ReturnTypeDescriptionPossible valuesExample
validate_exim_configuration_syntax
hash

A hash of configuration information.

This hash includes the rawout, status, error_msg, error_line, broken_cfg_html, and broken_cfg_text returns. 

rawout

string

The Exim configuration text's raw output.

The function returns this value in the validate_exim_configuration_syntax hash.

A valid string.
 Click to view...
Exim version 4.76 #1 built 16-Aug-2011 11:41:07\nCopyright (c) University of Cambridge,
1995 - 2007\nBerkeley DB: Sleepycat Software: Berkeley DB 4.3.29: (July 12, 2010)\nSupport for:
crypteq iconv() IPv6 PAM Perl OpenSSL Content_Scanning DKIM Old_Demime Experimental_SPF
Experimental_SRS\nLookups (built-in): lsearch wildlsearch nwildlsearch iplsearch dbm dbmnz passwd
\nAuthenticators: cram_md5 dovecot plaintext spa\nRouters: accept dnslookup ipliteral manualroute
queryprogram redirect\nTransports: appendfile/maildir autoreply pipe smtp\nSize of off_t: 8\n\n

status

Boolean

Whether the function failed.

The function returns this value in the validate_exim_configuration_syntax hash.

  • 1 — Success.
  • 0 — Failure.
 1

error_msg

string

Any error messages that the validation script encountered.

The function returns this value in the validate_exim_configuration_syntax hash.

Note:

The function only returns this value if the configuration syntax is invalid.

A valid string.
 Click here to expand...

"2016-06-09 09:58:21 Exim configuration error in line 1 of /etc/exim.conf.test.work.ND150FmsspHJlHg1:\n  malformed macro definition"

error_line

integer

The first line in the Exim configuration file that contains an error.

The function returns this value in the validate_exim_configuration_syntax hash.

Note:

The function only returns this value if the configuration syntax is invalid.


A positive integer.1

broken_cfg_html

string

The line that contains the broken configuration.

The function returns this value in the validate_exim_configuration_syntax hash.

Note:

The function only returns this value if the configuration syntax is invalid.


A valid string in HTML format.

"CONFIGURATIONFILE\n"

broken_cfg_text

string

The line that contains the broken configuration.

The function returns this value in the validate_exim_configuration_syntax hash.

Note:

The function only returns this value if the configuration syntax is invalid.


A valid string in plaintext format.

"==>CONFIGURATIONFILE<==\n"