AT&T Blocks Emails With Bare Line Feeds – How To Fix?

We require users to get verified when they register for an account on our site. I just got a bounceback I’ve never seen before.

“Your message contains invalid characters (bare line feed characters) which the email servers at don’t support.

It appears that your email program added invalid characters (bare line feed characters) into your message when you sent it. Try using a different email program to send your message. If the problem continues send this non-delivery report (NDR) message to your email admin for assistance.”

This is via Office 365, which we use and through which our web server relays emails. O365 adds this helpful info to bounceback messages. The confirmation email we use I think is pretty stock, from /admin/config/people/accounts:


Thank you for registering at [site:name]. Your application for an account is currently pending approval. Once it has been approved, you will receive another e-mail containing information about how to log in, set your password, and other details.


— [site:name] team

Apparently wants line endings to be “CRLF” instead of just “LF”. I’m not sure where or how the line feeds are created, but I assume they come from this email content and the lines are being broken with just the “LF”.

Has anyone seen this before? I assume it’s in the core code somewhere, the User module perhaps?

Addition: Just got the same bounceback from

I’ve never had this issue before, but now twice in one morning. The only change to the system lately has been to start using Microsoft’s cloud email as SMTP relay, but that change was made a couple weeks ago. Of course, we just might not have had any mail go to a server that is sensitive to this.

Drupal version: