Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8387643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:16:10+00:00 2026-06-09T18:16:10+00:00

Over the weekend our MTA (POSTFIX) suddenly started prepending line breaks to the boundaries

  • 0

Over the weekend our MTA (POSTFIX) suddenly started prepending line breaks to the boundaries of our messages.
We have several PHP templates that define multipart/alternative messages and define the headers.
Here is the PHP mailer format, which was working friday, then just suddenly stopped on monday.

$headers = "From: name <our@example.com>\r\n" .
   "Reply-To: name <our@example.com>\r\n" .
   "MIME-Version: 1.0\r\n" .
   "Content-Type: multipart/alternative; boundary=\"09127kjhd821\"";

$txt = "\r\n\r\n--09127kjhd821\r\n" .
   "Content-Type: text/plain; charset=UTF-8\r\n" .
   "Content-Transfer-Encoding: quoted-printable\r\n\r\n" .
   "Text Message";

$html = "\r\n\r\n--09127kjhd821\r\n".
   "Content-Type: text/html; charset=UTF-8\r\n" .
   "Content-Transfer-Encoding: base64\r\n\r\n" .
   chunk_split( base64_encode( "HTML Message") );

$body = $txt . $html . "\r\n\r\n--09127kjhd821--";

mail(
   "someone@example.com",
   "=?UTF-8?B?" . base64_encode( "Subject" ) . "?=",
   $body,
   $headers
);

Comparing the original mails to the broken ones i see the following
Broken:

Date: Fri,  3 Aug 2012 16:52:39 -0400 (EDT)





--09127kjhd821

Content-Type: text/plain; charset=UTF-8

Content-Transfer-Encoding: quoted-printable

Original (Working)

Date: Tue, 31 Jul 2012 12:36:45 -0400 (EDT)



--09127kjhd821
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

As you can see the line breaks are off pretty much doubling for each \r and \n, nothing was changed to my knowledge that would cause this.

Any suggestions or help is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:16:12+00:00Added an answer on June 9, 2026 at 6:16 pm

    The only thing I can come up with is the POSTFIX and PHP issues with converting LF to CRLF so when CRLF is defined in the message body for boundaries and headers it is being converted to CRCRLF.
    Saving the message source however only displays as CRLF in the hex editor though, which may be a conversion in the editor I use or email client download process.

    I still don’t understand why it just suddenly changed as it was working fine previously.
    The only difference I can think of is maybe due to the scripts line-endings that may have changed from CRLF to LF causing a conversion to take place and thus breaking emails that contain CRLF in the body.

    I ultimately fixed the issue by changing the sendmail_path in php.ini to

    sendmail_path="/usr/bin/dos2unix|/usr/sbin/sendmail -t -i"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Over the weekend, for some reason, one of our servers has decided to start
Ok, so I found something weird over the weekend. I have a WPF app
I have been playing around with zxing over the weekend, and have ran into
I'm learning a little C over the holiday weekend, and I started to look
Our networks guys installed this patch over the weekend to our single server sharepoint
I have been trying some different java compilers over the weekend and decided to
I'm going to create a small reminder system in PHP over the weekend. The
We're using sessions in our GAE/J application. Over the weekend, we had a large
Over the weekend, another programmer added a file to a project and committed it
Over the weekend the SQL Server 2008 R2 (running on Windows Server 2008 R2)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.