exim.conf rebuild fails with " too many named host lists (max is 16)" error

suberjin

Member
Jul 20, 2013
5
0
1
cPanel Access Level
Root Administrator
Hello,

when we try to use /scripts/buildeximconf it fails with error:

Configuration file has an invalid syntax. Please try the edit again.
Error message from syntax check:
2016-09-25 03:46:40 Exim configuration error in line 68 of /etc/exim.conf.buildtest.work.AxKJOEgx4nWnXxeq:
too many named host lists (max is 16)
It could be caused by our custom lists that we have in addition. Is there any way to use more than 16 named host lists ?
 

Techs-Y

Member
Sep 29, 2016
15
0
51
Germany
cPanel Access Level
Root Administrator
There are two ways how to fix this issue: reduce number of named lists or increase Exim limit but this requires Exim package rebuild. As we cannot disable any from our lists, we had to rebuild the cPanel source package and seems that it works fine.

But, sure, will be better if cPanel team increase MAX_NAMED_LIST at least to 32 to prevent Exim rebuilds each time after upgrade...
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello,

By default, Exim allows up to 16 named lists of each type. This limit can be extended by changing a compile-time variable, as mentioned in the previous post, and documented at:

10. Domain, host, address, and local part lists

However, this level of customization is unsupported. Could you let us know the purpose of your named host lists? Is it possible you could reduce the number?

Thank you.
 

Techs-Y

Member
Sep 29, 2016
15
0
51
Germany
cPanel Access Level
Root Administrator
Hello,

By default, Exim allows up to 16 named lists of each type. This limit can be extended by changing a compile-time variable, as mentioned in the previous post, and documented at:

10. Domain, host, address, and local part lists

However, this level of customization is unsupported. Could you let us know the purpose of your named host lists? Is it possible you could reduce the number?

Thank you.
Sorry, have no time to dig to this, let me show you something guys:
Code:
# grep 'hostlist' /etc/exim* -r | cut -d : -f 2 | sort -u | wc -l
14
That's number of hostlists present in default cPanel Exim configuration from scratch. As we already know, default limit on named lists of each type in Exim is 16 and you're forcing users to...have only up to 2 additional hostlists? Okay, no problem, but (please understand me correctly - i was some angry when found at least one possible reason why configuration previously working for many years unexpectedly proved wrong) please look below:
Code:
# grep cpanel_mail_netblocks /etc/exim* -r
# cat /usr/local/cpanel/version
11.42.1.12

# grep cpanel_mail_netblocks /etc/exim* -r
# cat /usr/local/cpanel/version
11.50.0.27

# grep cpanel_mail_netblocks /etc/exim* -r
/etc/exim.conf:hostlist cpanel_mail_netblocks = net-iplsearch;/etc/cpanel_mail_netblocks
/etc/exim.conf:    !hosts = : +neighbor_netblocks : +loopback : +trustedmailhosts : +recent_authed_mail_ips : +backupmx_hosts : +skipsmtpcheck_hosts : +senderverifybypass_hosts : +greylist_trusted_netblocks : +cpanel_mail_netblocks
/etc/exim.conf:    !hosts = : +trustedmailhosts : +cpanel_mail_netblocks
/etc/exim.conf:    !hosts = : +neighbor_netblocks : +loopback : +trustedmailhosts : +recent_authed_mail_ips : +backupmx_hosts : +skipsmtpcheck_hosts : +senderverifybypass_hosts : +greylist_trusted_netblocks : +cpanel_mail_netblocks
/etc/exim.conf:    !hosts = : +neighbor_netblocks : +loopback : +trustedmailhosts : +recent_authed_mail_ips : +backupmx_hosts : +skipsmtpcheck_hosts : +senderverifybypass_hosts : +greylist_trusted_netblocks : +cpanel_mail_netblocks
# cat /usr/local/cpanel/version
11.56.0.36
Have no exact information when this (cpanel_mail_netblocks) hostlist was added, but it looks like in 11.56 version exactly when this issue became a problem for me and our company as well for our clients). So, before adding of one more yours hostslist users were able to define at least 3 hostslists (that was enough at least for our configuration).

Content of the /etc/cpanel_mail_netblocks file:
Code:
# cat /etc/cpanel_mail_netblocks
208.74.120.0/21
And, after this you suggest to "reduce the number" of hostlists? May be to zero?..

Have a counteroffer: may be it make a sense to move your subnet whitelist to some other place (or remove it completely)? Or, one time apply patch to EDITME Exim file and increase MAX_NAMED_LIST value?

P.S. Please accept my apologies, but you cannot imagine how angry I am after one more exim (4.88-1.cp1162) rebuild.
 
Last edited:

Techs-Y

Member
Sep 29, 2016
15
0
51
Germany
cPanel Access Level
Root Administrator
Any updates, guys? Is there any ability to correctly remove cpanel_mail_netblocks hostlist from exim.conf and / or make sure that it will never be added back after exim package installation in case of use Exim Configuration Manager -> Advanced Editor?

In case there is any other way how to disable this hostlist - please advise.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Any updates, guys? Is there any ability to correctly remove cpanel_mail_netblocks hostlist from exim.conf and / or make sure that it will never be added back after exim package installation in case of use Exim Configuration Manager -> Advanced Editor?
Hello,

I browsed to "WHM >> Exim Configuration Manager >> Advanced Editor" and scrolled down to add three additional hostlist entries using the "Add Additional Configuration Configuration Setting" button. The changes were saved and the new Exim build completed successfully.

Could you let us know the specific steps you are taking to reproduce this error message?

Thank you.