1. Home
  2. Email
  3. How to Resolve a “Message Has Lines Too Long for Transport” Error 
  1. Home
  2. Troubleshooting
  3. How to Resolve a “Message Has Lines Too Long for Transport” Error 

How to Resolve a “Message Has Lines Too Long for Transport” Error 

Seeing a “Message has lines too long for transport” error can be confusing and frustrating, especially when you want your email to be delivered successfully. This error does not mean your account is broken; it simply means your message didn’t meet technical formatting rules that most email servers use to keep email reliable and secure. 

It simply means your email contained one or more lines that were too long for the mail server to safely process. 

This guide explains why this error happens, provides clear, actionable fixes for common causes, advanced server-level adjustments, and best practices to prevent future errors.

How to Resolve a "Message has lines too long for transport" Error

Understanding Email Protocols

Email protocols, such as SMTP (Simple Mail Transfer Protocol), impose a line length limit to ensure compatibility across different email systems. Email standards typically limit line length to 998 characters, and many servers enforce a recommended maximum of 78 characters per line to ensure compatibility across systems. 

When a line exceeds these limits, the mail server often rejects the message to prevent transport issues. 

What This Message Error Actually Means 

When emails travel between servers, they follow shared rules (called “standards”). One of those rules limits how long a single line of text can be. 

If an email contains lines that are too long, often because of formatting, attachments, or automation, the receiving server may reject it.

 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 

This is a server safety rule, not a personal failure or a 1-grid issue. 
 
This means your message wasn’t “wrong”; it just needs to be formatted in a way all email systems can accept. 

Most Common Causes for Why This Happens

At a Glance 

Symptom Likely Cause Fast Fix 
Error happens with long emails Lines too long Enable word wrap 
Error happens with HTML emails Formatting issue Switch to plain text 
Error happens with attachments Encoding issue Remove attachment & retry 
Error happens from forms/scripts No word wrap in code Add wordwrap() 
Error happens server-wide Exim limits too strict Adjust SMTP settings 

1. Very Long, Unwrapped Lines in Your Email 

Some email apps, copied text, or automated messages don’t automatically break long lines. 

TIP: Turning on word wrapping prevents rejections before you even hit send. 

2. HTML Formatting Issues 

Poorly structured or “minified HTML can create extremely long hidden lines. 

TIP: Proper formatting makes your email more compatible across all email systems. 

3. Attachments Encoded Incorrectly 

Large attachments can sometimes be encoded (like using Base64) in such a way that creates excessively long lines. 

TIP: Correct encoding keeps your attachments deliverable and readable. 

4. Strict Mail Server Settings (Exim/Postfix) 

Some servers, especially newer Exim versions, enforce stricter limits than before. 

TIP: If you manage your server, small adjustments can prevent unnecessary bounces. 

5. Email Sent Via Scripts or Forms 

Website forms, newsletters, or automated systems may not wrap text properly. 

TIP: One small code tweak can fix this permanently.

How to Fix It (Step-by-Step)

There are several different options that fix the “maximum line length for SMTP transports” error and make sure your emails go through smoothly. 

1. Enable Word Wrapping in Your Email App (Most Common Solution) 

Outlook (Windows & macOS) 
  1. Open Outlook 
  2. Go to File → Options → Mail 
  3. Scroll down to Message format and find “Automatically wrap text” 
  4. Set it between 65–78 characters 
  5. Click OK 
          Mozilla Thunderbird 
          1. Open Thunderbird 
          2. Go to Preferences > General 
          3. Under Composition, enable Wrap plain text messages at 78 characters 

              Why this matters: 
              This automatically keeps your messages within safe limits, so servers accept them. 

              2. Switch to Plain Text (Quick Test) 

              If the error keeps happening: 

              • Compose a new email 
              • Change format to Plain Text instead of HTML 
              • Try sending again 

              TIP: Plain text removes hidden formatting that can trigger this error. 

              3. Check Email Formatting in HTML Messages 

              If you’re sending HTML emails, ensure proper line wrapping: 

              • Use <br> or <p> tags instead of manually creating long lines. 
              • Avoid minifying HTML to extreme lengths. 
              • Ensure HTML content is formatted using a mail editor that properly breaks lines. 

              4. Break Up Very Long Lines Manually 

              If you’ve pasted large blocks of text: 

              • Press Enter every few sentences 
              • Avoid extremely long paragraphs 

              TIP: Simple formatting often resolves the issue instantly. 

              5. Check Attachments 

              If your message includes attachments: 

              TIP: This helps confirm whether the attachment is the trigger. 

              6. If You Use Automated Emails (Advanced) 

              If you are sending emails via scripts (PHP, Python, etc.), ensure correct line wrapping. 

              For PHP 

              Main: 

              $message = wordwrap($message, 78, "\r\n"); 

              Other: 

              $headers = "Content-Type: text/plain; charset=UTF-8" . "\r\n"; 
              mail($to, $subject, $message, $headers); 
              For Python 

              Main to review:  

              message.as_string().replace("\n", "\r\n") 

              Others to review:  

              import smtplib 
              from email.mime.text import MIMEText 
               
              message = MIMEText("Your message content here", "plain", "utf-8") 
              message["Subject"] = "Your Subject" 

              TIP: This prevents errors for all future automated emails. 

              Advanced Fix (Server Administrators Only) 

              If you manage your mail server (Exim/WHM/cPanel/Postfix (Linux)), you may need to adjust line limits. This may also help reduce false rejections while still keeping your server compliant. 

              Avoid setting this too high, as it can reduce compatibility with other mail systems and check if the changes worked by keeping an eye on your mail server logs. Make sure that the adjustments have successfully fixed the “Message Has Lines Too Long For Transport” issue. 

              Exim (WHM/cPanel) 

              1. Log in to WHM (Web Host Manager) 
              2. Search for Exim, and then open Exim Configuration Manager 
              3. Increase Maximum Line Length for SMTP Transports (e.g., to 40000) 
                • The default value is usually set at 2048. Consider making it higher, like 40000, to allow for longer email lines. Find the field for this value and type in the number you want. 
                • 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. 
              4. Click Save to apply the changes 

                        Alternative steps:  

                        1. Locate your configuration file (usually /etc/exim/exim.conf). 
                        2. Add or update
                          message_size_limit = 52428800 
                          1. Restart Exim: 
                          sudo systemctl restart exim 

                          Postfix (Linux) 

                          1. Open the configuration file: (usually sudo nano /etc/postfix/main.cf). 
                          2. Add or update to allow longer transport lines (example):
                            message_size_limit = 52428800 
                            1. Restart Postfix: 
                            sudo systemctl restart postfix 

                              IMPORTANT: These changes require server admin access and should be done with caution. 

                              Advanced Troubleshooting (If Problem Persists) 

                              1. Review Server Logs 

                              Look for entries related to transport limits: 

                              Postfix (Linux): 
                              sudo cat /var/log/mail.log | grep transport 
                              Exchange (Windows): 

                              Logs are typically found at: 

                              C:\Program Files\Microsoft\Exchange Server\V15\Logging\TransportRole 

                              2. Test with a Different Email Client 

                              If the issue only occurs with one client, it might be a formatting issue specific to that application. 

                              Best Practices to Prevent This in Future 

                              • Keep emails reasonably formatted 
                              • Avoid extremely long single paragraphs 
                              • Use proper HTML structure if sending rich emails 
                              • Ensure any automation includes line wrapping 
                              • If you manage a server, set sensible SMTP limits 

                              TIP: Prevention saves you time, avoids frustration, and improves deliverability. 

                              Our Scope of Support 

                              If you’re stuck and need any additional guidance or support, here’s an outline of what we can do and what is not within our Scope of Support

                              Included Support 

                              We can

                              • Guide you through word wrapping and email formatting 
                              • Interpret error details 
                              • Confirm whether emails are reaching 1-grid servers 
                              • Advise on next troubleshooting steps 

                              Advanced Support (Paid Services) 

                              While some tasks fall outside Standard Support, we can still help through our Paid Services offering. These tasks require specialised work and are quoted before we begin.   

                              Outside Our Scope 

                              We do not directly control: 

                              • Your personal device settings 
                              • Third-party email apps 
                              • External email provider policies 
                              • Your home or corporate firewall 

                              If the issue is local, we’ll guide you clearly toward the right next step. 

                              FAQ

                              Q: Will shortening my email always fix this?

                              Usually yes, especially if the issue is long, unwrapped lines.

                              Q: Is this a security problem?

                              No, as it’s a formatting/transport rule, not a breach.

                              Q: Can this happen in any email app?

                              Yes, Outlook, Apple Mail, Gmail, Thunderbird, and automated systems can all trigger it.

                              Q: Should I use Plain Text or HTML?

                              Plain Text is safest; HTML is fine if properly formatted.

                              Additional Resources 

                              How to Fix an “Email Address Rejected by Server” Error 
                              How to Fix a “Cannot Verify Server Identity” Error 
                              Troubleshooting Email Sending Issues 
                              Basic Troubleshooting Steps for Email 
                              Email Error Messages: What Do They Mean and How to Fix Them 

                              Need Additional Support? 

                              We’re Here to Help: 

                              Resolving the challenge of having lines too long in your messages doesn’t have to feel technical with this easy-to-reference guide. Stuck? Check out our Scope of Support, and then contact our Support Team for further clarity and guidance (https://1grid.co.za/contact-us/). We’re ready to see how we can help! 

                              Updated on January 20, 2026

                              Was this article helpful?

                              Related Articles