SOLVED Problem CPANEL-39824 : message has lines too long for transport - Since January 21, 2022

mickael

Well-Known Member
Aug 3, 2014
57
9
58
cPanel Access Level
Root Administrator
Can I apply @Reado tip without breaking anything in the future? Imagine if in a few days Exim is updated again canceling Exim 4.94? or imagine if it breaks updates that don't want to run later ?
 

mickael

Well-Known Member
Aug 3, 2014
57
9
58
cPanel Access Level
Root Administrator
@Reado
I just did this "yum downgrade cpanel-exim-4.94.2-4.cp1198.x86_64.rpm" is it's great it works fine, thanks it's great.
I didn't need to put the chown because it's correct on both names, the test email works, I'll be able to reopen the registrations pages this evening.
Hopefully it doesn't break anything like for example the Exim 4.95 update coming back again soon or also imagine if exim doesn't want to auto-update at all in the future because of this manually installed rpm?!
 

alfonsofp

Registered
Feb 1, 2022
4
0
1
Spain
cPanel Access Level
Root Administrator
@Reado
I just did this "yum downgrade cpanel-exim-4.94.2-4.cp1198.x86_64.rpm" is it's great it works fine, thanks it's great.
I didn't need to put the chown because it's correct on both names, the test email works, I'll be able to reopen the registrations pages this evening.
Hopefully it doesn't break anything like for example the Exim 4.95 update coming back again soon or also imagine if exim doesn't want to auto-update at all in the future because of this manually installed rpm?!
I just paused the auto update feature, because 102.0.2 will go back to Exim 4.95 and @abonoit said the problem is still there. I will resume the automatic update when there is a version that does not cause the issue.
 

DennisMidjord

Well-Known Member
Sep 27, 2016
361
80
78
Denmark
cPanel Access Level
Root Administrator
Thanks for keeping us updated, @cPRex - and thanks for providing a fix so quick.

It seems like a lot of server admins use either Current or Edge on production servers and then start crying when stuff doesn't work. If you want to have the latest and greatest features available, there's noone else to blame than yourself when stuff inevitably breaks.

Everyone who has been blaming cPanel for this issue, do yourself a favor and:
1. Block cPanel from updating automatically (Can I disable automatic cPanel updates?)
2. Wait for v102.0.2 to reach either LTS, Stable or Release
3. Change your update prefences to one of those tiers
If you cannot afford to deal with any issues at all, select the LTS tier.
 
  • Like
Reactions: cPRex

mickael

Well-Known Member
Aug 3, 2014
57
9
58
cPanel Access Level
Root Administrator
In the afternoon I followed @Reado tip while still using Cpanel/whm 102.0.1:

Code:
wget http://httpupdate.cpanel.net/RPM/11.98/centos/7/x86_64/cpanel-exim-4.94.2-4.cp1198.x86_64.rpm


yum downgrade cpanel-exim-4.94.2-4.cp1198.x86_64.rpm
(didn't need to adjust the duties, they were correct)

then mails worked fine again with Exim 4.94.2.

Now I am under Cpanel/whm 102.0.2 and I did this next:

Code:
/usr/local/cpanel/scripts/check_cpanel_pkgs --fix
he put Exim 4.95 #2 and mails from PHP's mail() function still don't work

[01:10:39] root@ns [~]# exim --version
Exim version 4.95 #2 built 22-Nov-2021 18:04:21
Copyright (c) University of Cambridge, 1995 - 2018
(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 - 2020
Berkeley DB: Berkeley DB 5.3.21: (May 11, 2012)
Support for: crypteq iconv() IPv6 PAM Perl OpenSSL TLS_resume Content_Scanning DANE DKIM DNSSEC Event I18N OCSP PIPE_CONNECT PRDR Experimental_Queue_Ramp SPF Experimental_SRS
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch passwd sqlite
Authenticators: cram_md5 dovecot plaintext spa
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir autoreply lmtp pipe smtp
Malware: f-protd f-prot6d drweb fsecure sophie clamd avast sock cmdline
Configure owner: 0:0
Size of off_t: 8
2022-02-02 01:11:43 cwd=/root 2 args: exim --version
Configuration file is /etc/exim.conf
[01:11:43] root@ns [~]#

Now as soon as you want to try @Reado tutorial with this Cpanel/whm 102.0.2 version:

Code:
yum downgrade cpanel-exim-4.94.2-4.cp1198.x86_64.rpm
it puts the exim version 4.94 but Exim does not start, it indicates this error:


2022-02-02 01:21:47 cwd=/ 2 args: /usr/sbin/exim -bV
2022-02-02 01:21:47 Exim configuration error in line 2533 of /etc/exim.conf:
option "message_linelength_limit" unknown
Configuration file has an invalid syntax. Please try the edit again.


[01:22:29] root@ns [~]# service exim stop
Redirecting to /bin/systemctl stop exim.service
[01:22:35] root@ns [~]# service exim start
Redirecting to /bin/systemctl start exim.service
Job for exim.service failed. See "systemctl status exim.service" and "journalctl -xe" for details.
[01:22:37] root@ns [~]# systemctl status exim.service
● exim.service - Exim is a Mail Transport Agent, which is the program that moves mail from one machine to another.
Loaded: loaded (/etc/systemd/system/exim.service; enabled; vendor preset: disabled)
Active: failed (Result: protocol) since mer. 2022-02-02 01:22:37 CET; 9s ago
Process: 15783 ExecStart=/usr/libexec/exim.daemon start (code=exited, status=0/SUCCESS)
Main PID: 6883 (code=exited, status=0/SUCCESS)

févr. 02 01:22:37 ns.ServerName.com systemd[1]: Starting Exim is a Mail Transport Agent, which is the program that moves mail from one machine to another....
févr. 02 01:22:37 ns.ServerName.com exim.daemon[15783]: 2022-02-02 01:22:37 Exim configuration error in line 2533 of /etc/exim.conf:
févr. 02 01:22:37 ns.ServerName.com exim.daemon[15783]: option "message_linelength_limit" unknown
févr. 02 01:22:37 ns.ServerName.com systemd[1]: Can't open PID file /var/spool/exim/exim-daemon.pid (yet?) after start: No such file or directory
févr. 02 01:22:37 ns.ServerName.com systemd[1]: Failed to start Exim is a Mail Transport Agent, which is the program that moves mail from one machine to another..
févr. 02 01:22:37 ns.ServerName.com systemd[1]: Unit exim.service entered failed state.
févr. 02 01:22:37 ns.ServerName.com systemd[1]: exim.service failed.
[01:22:46] root@ns [~]#


I just put back the exim version 4.95 with
Code:
/usr/local/cpanel/scripts/check_cpanel_pkgs --fix

[01:23:34] root@ns [~]# service exim stop
Redirecting to /bin/systemctl stop exim.service
[01:23:38] root@ns [~]# service exim start
Redirecting to /bin/systemctl start exim.service
[01:23:41] root@ns [~]#

Mail server with php mail() function still not working even with Cpanel/whm version 102.0.2
 

mickael

Well-Known Member
Aug 3, 2014
57
9
58
cPanel Access Level
Root Administrator
It is correct now for exim 4.94. I commented out the following two lines in /etc/exim.conf:

Code:
#message_linelength_limit = 2048
It started !
 

Reado

Well-Known Member
Sep 8, 2009
256
16
68
United Kingdom
cPanel Access Level
Root Administrator
I can confirm that v102.0.2 has not resolved the issue for me either.

With v102.0.2 installed, In addition to downgrading Exim I also had to remove the message_linelength_limit entries from the exim.conf file after which I could send emails again.

cPanel, perhaps it would be an idea for you to rollback Exim to the previous version and re-release the CURRENT & EDGE branches until the problem has been properly resolved. Although I'm surprised this hasn't been done sooner considering this issue has been occurring for 10+ days!
 
  • Like
Reactions: tinoandrijic

DennisMidjord

Well-Known Member
Sep 27, 2016
361
80
78
Denmark
cPanel Access Level
Root Administrator

Reado

Well-Known Member
Sep 8, 2009
256
16
68
United Kingdom
cPanel Access Level
Root Administrator
In case anyone else is experiencing the same issue, after downgrading Exim I could no longer make changes to the Exim configuration via WHM as it was re-inserting the "message_linelength_limit" and therefore failing to save the configuration.

To workaround this, I had to remove both "message_linelength_limit" entries from "/usr/local/cpanel/etc/exim/replacecf/dkim/remote_smtp" after which I could make changes to the Exim configuration via WHM.

cPanel; how do I stop UPCP from upgrading Exim to the newer version and thus breaking things? Can I simply add "cpanel-exim*" to the "/etc/yum.conf" exclude or is there something else I need to do?
 

cPanelZach

Member
Staff member
May 22, 2019
12
0
76
Houston
cPanel Access Level
Website Owner
If you are still experiencing issues with Exim in v102.0.2, please open a ticket. Additionally, if you are using a custom router it may be necessary to add the configuration line to the transport:

Code:
message_linelength_limit = 2048
Current configs can be checked easily with the following:

Code:
# exim -bP transport_list | while read list ; do echo "$list" ; exim -bP transport $list | grep line ; done
customsmarthosttransport
message_linelength_limit = 2048
remote_smtp
message_linelength_limit = 2048
dkim_remote_smtp
message_linelength_limit = 2048
 
Last edited by a moderator:

sgrzy01

Registered
Jan 29, 2022
3
1
3
Philadelphia, PA
cPanel Access Level
Root Administrator
Ok... I'm been asking my clients to patiently wait for 102.0.2 which appears not have helped the php mailer function....

Can I simply increase this value in the 4.95 exim.config?

Code:
remote_smtp:
  driver = smtp
  interface = <; ${if > {${extract{size}{${stat:/etc/mailips}}}}{0}{${lookup{${lc:${perl{get_message
_sender_domain}}}}lsearch{/etc/mailips}{$value}{${lookup{${if match_domain{$original_domain}{+relay_
domains}{${lc:$original_domain}}{}}}lsearch{/etc/mailips}{$value}{${lookup{${perl{get_sender_from_ui
d}}}lsearch*{/etc/mailips}{$value}{}}}}}}}}
  helo_data = ${if > {${extract{size}{${stat:/etc/mailhelo}}}}{0}{${lookup{${lc:${perl{get_message_s
ender_domain}}}}lsearch{/etc/mailhelo}{$value}{${lookup{${if match_domain{$original_domain}{+relay_d
omains}{${lc:$original_domain}}{}}}lsearch{/etc/mailhelo}{$value}{${lookup{${perl{get_sender_from_ui
d}}}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}}}}}{$primary_hostname}}
  hosts_try_chunking = 198.51.100.1
  message_linelength_limit = 2048



dkim_remote_smtp:
  driver = smtp
  interface = <; ${if > {${extract{size}{${stat:/etc/mailips}}}}{0}{${lookup{${lc:${perl{get_message
_sender_domain}}}}lsearch{/etc/mailips}{$value}{${lookup{${if match_domain{$original_domain}{+relay_
domains}{${lc:$original_domain}}{}}}lsearch{/etc/mailips}{$value}{${lookup{${perl{get_sender_from_ui
d}}}lsearch*{/etc/mailips}{$value}{}}}}}}}}
  helo_data = ${if > {${extract{size}{${stat:/etc/mailhelo}}}}{0}{${lookup{${lc:${perl{get_message_s
ender_domain}}}}lsearch{/etc/mailhelo}{$value}{${lookup{${if match_domain{$original_domain}{+relay_d
omains}{${lc:$original_domain}}{}}}lsearch{/etc/mailhelo}{$value}{${lookup{${perl{get_sender_from_ui
d}}}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}}}}}{$primary_hostname}}
  dkim_domain = ${perl{get_dkim_domain}}
  dkim_selector = default
  dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
  dkim_canon = relaxed
  hosts_try_chunking = 198.51.100.1
  message_linelength_limit = 2048
 
  • Like
Reactions: mickael

mickael

Well-Known Member
Aug 3, 2014
57
9
58
cPanel Access Level
Root Administrator
@cPanelZach
I just put back exim 4.95 with /usr/local/cpanel/scripts/check_cpanel_pkgs --fix

The result of exim -bP transport_list | while read list ; do echo "$list" ; exim -bP transport $list | grep line ; done :

remote_smtp
message_linelength_limit = 2048
dkim_remote_smtp
message_linelength_limit = 2048
address_directory
address_pipe
virtual_address_pipe
jailed_address_pipe
jailed_virtual_address_pipe
cagefs_address_pipe
cagefs_virtual_address_pipe
address_file
boxtrapper_autowhitelist
local_boxtrapper_delivery
virtual_boxtrapper_userdelivery
dovecot_delivery
dovecot_virtual_delivery
address_reply
Is one missing or is that normal?

I just tried the mail() function of php, and it doesn't work anymore (before with exim 4.94 it worked)


Edit: I just put back exim 4.94
 
Last edited:

mickael

Well-Known Member
Aug 3, 2014
57
9
58
cPanel Access Level
Root Administrator
@sgrzy01 I just tried it and it works!!
I put this for both:

message_linelength_limit = 2048000

On Exim version 4.95

So then on exim 4.94 and earlier versions we can consider that this parameter was on unlimited per default ?
 

cPanelZach

Member
Staff member
May 22, 2019
12
0
76
Houston
cPanel Access Level
Website Owner
@sgrzy01 It is possible to edit the exim.conf or the /usr/local/cpanel/etc/exim/replacecf/dkim/remote_smtp and /usr/local/cpanel/etc/exim/replacecf/remote_smtp files (and then running /scripts/buildeximconf) to increase this beyond the 2048 value that cPanel sets in 100.0.2 (Exim's new default is 998). However these changes will possibly be overwritten during upcp. The replacecf method is more robust in this manner and generally the Exim configurations will not be changed unless there's update to them either via upcp or WHM.


@mickael The output was an example if you had a custom router, in this case "customsmarthosttransport" was a placeholder for a transport you may have. Default configurations will only output the two default transports that have the line length enforced.

Outlook can add headers of around 1012 characters which triggered the error message, however any message formatted with long line lengths can likely cause this issue. Custom PHP mailers or similar should be configured to wrap lines after a certain length and the specifics of doing so depends on the software. Excessive line lengths have been noted to cause problems sending messages to Gmail for instance and where possible the max length should be set to 998 characters.
 

mickael

Well-Known Member
Aug 3, 2014
57
9
58
cPanel Access Level
Root Administrator
@cPanelZach
@sgrzy01 I just tried it and it works!!
I put this for both:

message_linelength_limit = 2048000

On Exim version 4.95

So then on exim 4.94 and earlier versions we can consider that this parameter was on unlimited per default ?
Since I put this it works well with mail() fonction PHP!
Should I just leave it like that?!
 
Last edited:

leandrokohler

Registered
Feb 2, 2022
3
1
3
Brazil
cPanel Access Level
Root Administrator
Same issue here, even after updating cPanel yesterday to 102.0.2. I temporary solved it by adding message_linelength_limit = 2048000 in /etc/exim.conf
But it will be overwritten in next update

I opened a new (second) ticket with cPanel regarding this problem.