Drupal uses the mail mimeheader "format=flowed;" (mail.inc [100]) correctly as described in RFC3676 (http://www.faqs.org/rfcs/rfc3676.html ).

The problem is, that many mailclients don't support this (including gmail: http://www.google.com/support/forum/p/gmail/thread?tid=2d9e6f5cd1c67a07&... ).

This leads to many emails being rendered without linebreaks at all.
Example: http://drupal.org/node/190236

I'm not sure as to how the fix should look like, but it needs to be adressed...

CommentFileSizeAuthor
#5 Default-Contact-Form_Formatting.txt1019 bytesstewest

Comments

extexan’s picture

Really?!? This issue is more than 3.5 years old and hasn't been addressed yet?

You know, many sites are still on D6. Can we get this fixed please?

pancho’s picture

Version: 6.x-dev » 8.x-dev

mail.inc still uses "format=flowed" in D8.
That being said, the problem might be already solved upstream, so we don't have to workaround.
The question now is whether major mailclients now correctly support "format=flowed".
Moving this to the D8 queue, so we're keeping track.

To be sure, we should probably check at least half of this list:

  1. Thunderbird
  2. Outlook
  3. Kmail
  4. Lotus / IBM Notes
  5. Gmail
  6. Yahoo! Mail
  7. outlook.com
  8. AOL Mail
  9. SquirrelMail
  10. RoundCube
  11. IMP / Horde
  12. Zimbra
extexan’s picture

@Pancho, thanks for the reply. After doing a little more digging, I don't think this is related to "format=flowed". I think this code in drupal_wrap_mail() is the culprit...

  // Check if the string has line breaks.
  if (strpos($text, "\n") !== FALSE) {
    // Remove trailing spaces to make existing breaks hard.
    $text = preg_replace('/ +\n/m', "\n", $text);
    // Wrap each line at the needed width.
    $lines = explode("\n", $text);
    array_walk($lines, '_drupal_wrap_mail_line', array('soft' => $soft, 'length' => strlen($indent)));
    $text = implode("\n", $lines);
  }
  else {
    // Wrap this line.
    _drupal_wrap_mail_line($text, 0, array('soft' => $soft, 'length' => strlen($indent)));
  }


This is not testing for "format=flowed" anywhere. So, as I understand it, consecutive lines without blank lines to separate them will be put together as a paragraph - which is exactly what is happening in my case. Here's what I want to show in an email:

Here are the details of your request:

Field 1: value 1
Field 2: value 2
Field 3: value 3

If you want to edit your request... yadda, yadda, yadda...


Here's what I get...

Here are the details of your request:

Field 1: value 1 Field 2: value 2 Field 3: value 3

If you want to edit your request... yadda, yadda, yadda...


So, without a parameter I can feed to drupal_mail() to tell it NOT to use this method, I can't do anything in my email to make it appear as I would like.

extexan’s picture

I've found that drupal_wrap_mail() is NOT the culprit after all. But it gets stranger and stranger. I'm actually sending 3 different emails at once. The difference between them is the addition of one field in the list of fields (which is where the problem manifests itself) in the 2nd and 3rd emails. I noticed that the first of the 4 fields is on a line by itself, like this:

Here are the details of your request:

Field 1: value 1
Field 2: value 2 Field 3: value 3 Field 4: value 4

If you want to edit your request...

If I then add an extra blank line between fields 2 and 3, I get this (which is exactly how it appears in my code):

Here are the details of your request:

Field 1: value 1
Field 2: value 2

Field 3: value 3
Field 4: value 4

If you want to edit your request...

What I don't understand is: why are fields 2,3,4 combined on one line in the first example (and why is field 1 not included), and why does the same not happen with the pairing of 1,2 and 3,4 in the second example? Can anyone explain this behavior?

stewest’s picture

Issue summary: View changes
StatusFileSize
new1019 bytes

Hi there.

Funny story this side, and I was about to create my own issue, but perhaps this is the place to post it?

The Contact forms, are sending mail with too many line breaks in my case.

See code:

username<br>
(<a href="http://myurl/users/myusername" rel="noreferrer" target="_blank">http://url.co.za.dev.<wbr>server.workbreak.url.io/users/my<wbr>user</a>) sent a<br>
message using the contact form at<br>
<a href="http://myurl/contact/contact_form" rel="noreferrer" target="_blank">http://url.co.za.dev.<wbr>server.broken.url.io/users/my<wbr>user<br>
<br>
Name<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;stew<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;Email<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:myemail@gmail.com" target="_blank">myemail@gmail.com</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;Subject<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tester<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;Message<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tester message<br>
<br>

It looks like this issue is related

https://www.drupal.org/node/1447236

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

This was an bugsmash group triage issue.

Comment #2 suggests that this has been fixed upstream. Then #4 is an example of an email produced with unexpected results but there are no steps to reproduce that particular problem.

Is this issue still a problem?

There has been no activity here for 7 years so maybe it has been fixed.

Since we need more information to move forward with this issue, I am setting the status at Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

Thanks!

extexan’s picture

My 2 cents... The original issue is from 2009. My coments were 10 years ago. The issue has gone from D8.0 (or whatever version it was originally posted for) through to D9.5 (as I write this). I'd say this should be closed and re-opened (or a new issue created) if someone runs into the issue again.

quietone’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

There has been no further information provided to confirm that this is still a problem. Therefor, I am closing.

If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").

Thanks!