Skip to content

550 5.6.11 bare line feeds: why mail bounces and how to fix it

550 5.6.11 means your message contains a bare line feed, an LF without a CR, and the receiving server refused it. Fix it by sending CRLF line endings.

Koltrix Team7 min read
A computer screen filled with source code
Photo by Chris Ried on Unsplash
On this page(11 sections)
  1. What does 550 5.6.11 mean?
  2. What is a bare line feed?
  3. Why do some servers reject bare line feeds?
  4. Where do bare line feeds come from?
  5. How can you check a saved message for bare line feeds?
  6. How do you fix it in code?
  7. What about 550 5.6.0 and "line too long" errors?
  8. Can the recipient fix it?
  9. A short checklist
  10. Where does Koltrix fit?
  11. Bottom line

A bounce that says "550 5.6.11 invalid message content" with the words "bare line feeds" means the message you sent has at least one line that ends in LF alone instead of CR LF, and the receiving server will not take it. The fix is almost always on the sending side: make every line ending in the raw message a CR LF pair.

This post covers that one error and its close relative, the "maximum line length" rejection. It explains what a bare line feed is, why some servers refuse it, how to find the offending lines in a saved message, and how to fix the code or client that produced them.

What does 550 5.6.11 mean?

550 is the SMTP reply code for a permanent failure. 5.6.11 is an enhanced status code: class 5 is permanent, subject 6 is "media error" in RFC 3463, and the Microsoft Exchange Online documentation uses detail 11 for a message that contains bare line feeds. Your sender should not retry. If you want the whole decoder, see SMTP enhanced status codes, decoded.

The text after the code varies. Microsoft's documentation describes the cause as a message that contains bare line feeds sent to a destination server that does not support them. You may also see "invalid message content" with a longer explanation. Match on the numbers and treat the text as a hint.

What is a bare line feed?

A bare line feed is a line feed character (LF, ASCII 10) that is not immediately preceded by a carriage return (CR, ASCII 13). Email lines are supposed to end with CR LF. A line that ends in LF alone is the Unix convention, and it leaks into email whenever text is built on Linux or macOS and handed to an SMTP connection without conversion.

The Internet Message Format standard is explicit. RFC 5322 section 2.3 says that CR and LF must only occur together as CRLF and must not appear independently in the body. A message that breaks that rule is not a valid Internet message, however readable it looks in an editor.

Why do some servers reject bare line feeds?

Servers reject them because accepting them is risky for security and for signatures, and because the old workaround is gone. According to Microsoft's article on this error, a message with bare line feeds can only travel between servers using SMTP chunking, the BDAT command defined in RFC 3030. A destination that does not support BDAT cannot accept such a message.

The same article says Microsoft 365 used to remove bare line feeds so that mail could reach older servers, and that to better support security standards such as DKIM it no longer does. That matters for signed mail: a signature covers the bytes of the message, so a relay that quietly rewrites line endings can break the signature. For a related failure, see DKIM body hash did not verify.

The practical result is that a message that once squeezed through can start bouncing when the path changes, even though you changed nothing.

Where do bare line feeds come from?

They come from whatever assembled the raw message. The usual sources are:

Source What happens
Code that builds the message by hand Strings joined with \n and written straight to the socket
Templates and stored bodies A body saved with LF endings is pasted into the message unchanged
Attachments A text attachment or an inline part keeps LF endings from its source file
Desktop mail clients and add-ins Some client, plugin or antivirus scanner inserts an LF while processing the message
Mail pipelines A relay or filter that rewrites bodies and normalizes endings incorrectly

Microsoft's guidance for people who sent the message is to try another mail program that does not add bare line feeds, such as Outlook on the web, and to try sending without the attachment if there was one. Those two steps fit the table: they swap the client, and they remove a part that may carry its own line endings.

How can you check a saved message for bare line feeds?

Save the failing message as a raw .eml file or capture the exact bytes you handed to your SMTP library, then count lines that do not end in CR. On Linux or macOS with GNU grep:

# lines that do NOT end with CR (each one is a bare LF)
grep -cvP '\r$' message.eml

# show the first few offending line numbers
grep -nvP '\r$' message.eml | head

A result of 0 means every line ends in CR LF. A larger number means you have bare line feeds. Be careful that your tool did not already normalize the file: some editors and download paths convert endings silently, so test the bytes your code actually sent, not a copy that has been through a text editor.

If you can reproduce the send, swaks lets you replay a raw message against the destination and see the exact SMTP reply, which is faster than waiting for a customer to resend.

How do you fix it in code?

Normalize every line ending to CR LF at the last moment before the message is serialized, and do it for each text part, not just the main body. A minimal version in Python:

import re

def to_crlf(text: str) -> str:
    # turn any CRLF, bare CR or bare LF into a single CRLF
    return re.sub(r"\r\n|\r|\n", "\r\n", text)

body = to_crlf(body)

The regular expression matches a CR LF pair first, so existing pairs are not doubled. The same idea works in any language: replace CR LF, CR and LF with CR LF in one pass.

Where you can, do not assemble raw messages by hand. Mail libraries built for sending, such as Python's email package with its SMTP policy, are designed to produce CR LF when they serialize a message. If you are on a hand-built path, see MIME structure for developers for what a well-formed message looks like.

Two cautions. Never rewrite line endings inside raw binary data; encode attachments as base64 and normalize the encoded text instead. And normalize before you sign: if you add a DKIM signature, compute it over the final CR LF form.

What about 550 5.6.0 and "line too long" errors?

Those are a different limit, and the fix is different. RFC 5322 section 2.1.1 says each line must be no more than 998 characters and should be no more than 78, excluding the CR LF. A message with a longer line can be refused with text such as "maximum allowed line length is 998 octets".

Common causes reported in community threads are a very long unbroken line of HTML, a base64 blob that was not wrapped, and a header that grew with every reply until it exceeded the limit. Treat those as likely suspects to check, not as a guarantee; confirm against your own message.

To find long lines in a saved message, count characters per line. Each line includes its CR, so flag anything over 999:

awk '{ if (length($0) > 999) print NR ": " length($0) }' message.eml

The fix is to fold long header values and wrap long body lines. For HTML emails, a mail library that encodes the body as quoted-printable or base64 wraps lines for you. For plain text, wrap at around 78 characters.

Can the recipient fix it?

Yes, but you usually cannot make them. Microsoft's article lists two options for the recipient's administrator: turn off bare line feed rejection on the server if it supports that, or move to server software that supports BDAT. For Exchange Server, it names the BareLinefeedRejectionEnabled setting on the Receive connector for internet mail, set to $false.

Asking a customer's IT team to loosen security settings because your message is malformed is rarely a good trade. Fix the message first and keep the recipient-side change as a last resort for a sender you cannot change.

A short checklist

  1. Read the bounce for 5.6.11 and "bare line feeds", or for a line-length message.
  2. Capture the raw bytes that were actually sent.
  3. Run the grep check for lines that do not end in CR.
  4. Normalize every text part to CR LF before serializing and signing.
  5. Wrap lines that exceed 998 characters, and aim for about 78.
  6. Test against the failing destination with a raw replay before you turn the sender back on.

Where does Koltrix fit?

Koltrix is AI-first email for SaaS teams, with a transactional email API and an SMTP relay. If you send through an API, you hand over content and the service builds the message, which removes most hand-assembled line endings. If you speak SMTP directly, the line endings you write are the line endings that get sent, so the checks above apply. For choosing between the two paths, see SMTP relay vs HTTP API. If an AI assistant reads your mailbox through the Koltrix MCP server, a bounce like this is just another message it can summarize and help you act on. Check docs.koltrix.com for exact sending behavior.

Bottom line

550 5.6.11 is a formatting error, not a reputation problem. A bare line feed is an LF with no CR in front of it, RFC 5322 forbids it, and many servers now refuse it because Microsoft 365 no longer cleans it up for them. Find the lines, convert every ending to CR LF before you serialize and sign, and keep lines under 998 characters. Changing the recipient's server is possible but should be the last step.

Start with Koltrix

Your domain, one inbox, and an API that sends.

A team inbox where AI sorts and drafts (nothing is sent without your click), plus the transactional API and SMTP relay your product sends with. 7 days free, no card.

SharePost on XLinkedIn