Resolving the mail Sending Error: "message has lines too long for transport"

In many case a recent update of cPanel can cause a problem for many people trying to send emails from the server. Users on this server using WHM could get bounce emails with a message: message has lines too long for transport.

This issue is entirely caused by an EXIM update, which made cPanel also update and set a limit on the maximum(default value) line length in sending emails.

The problem can be noticed by seeing PHP Mail and other packages don't break lines. In other words - any large or HTML emails will have this issue. This problem can be noticed in Outlook as well.

The sender usually gets a bounce email with a specific subject when this happens.

Sample of Bounce email:
Subject: Mail delivery failed: returning message to sender
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: message has lines too long for transport
Action: failed

Here is what can be done in order to get the problem maximum line length for SMTP transports solved and your emails delivered smoothly.

Adjusting Max Linе Lеngth for SMTP Transports in cPanеl/WHM


In order to fix the Message Has Lines Too Long for Transport problem, cPanel can change a setting called Max Line Length for SMTP transports. This way you will avoid the error of the lines being too long. Follow these advises:

1. Log in to your WHM (Web Host Manager) control panel if you have it (in most cases if you have VPS/VDS, WHM comes with it).

2. Go to the search feature in WHM (top left) to find Exim and click on Exim Configuration Manager.


WHM Exim Configuration Manager

3. Take a look at Maximum Line Length for SMTP Transports setting in the Exim Configuration options (Basic Editor).

4. The default value is most cases set at 2048. You should make it higher, like 40000, just to allow for longer email lines. Find the field for this value and type in the number you want.


Maximum Line Length for SMTP Transports

5. Click on the Save button to apply the changes and you are done. New value is set.

Now you can check if the changes are visible by keeping an eye on your mail server logs too. Also, make sure for yourself that the adjustments have successfully fixed the "Message Has Lines Too Long For Transport" issue.

In future you can prevent the Message Has Lines Too Long For Transpor error by monitoring your mail server logs and email client logs for any errors. In case you see that your message is rejected because it's too long, adjust again the limit to allow for longer messages pass through.

While setting the Max Line Length for SMTP transports to a high number can help with the Message Has Lines Too Long For Transport error on a cPanel server, it's not the best solution. Use a value that fits the longest emails you send without exceeding the maximum line length.

Another way to fix it, is just to use a different email client. Sometimes, this error happens because of the email client used by the person sending the email. Certain email clients may not format messages correctly, causing them to be too long.

Switching to a different email client (like Outlook, please check: Error - Message has lines too long for transport) could solve the problem and make sure your emails go through without any issues.


Was this article helpful?

mood_bad Dislike 0
mood Like 2
visibility Views: 1334