Closed (outdated)
Project:
Drupal core
Version:
6.x-dev
Component:
mail system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Sep 2008 at 16:40 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fonant commentedI've done a quick workaround using a fix-up at the end of drupal_wrap_mail():
but this doesn't feel "correct", as any line that has just two hyphens will be turned into signature separators, even if that wasn't the intention when composing the body text.
It strikes me that it would be nicer if the $message array used by drupal_mail() had a ['signature'] in it, which could then be appended to the end of the message, using the standard separator, within drupal_mail_send(). This would also keep the signature separate from the body of the message within the data array, which may have its uses.
Comment #2
dave reidComment #3
Waltemath commentedThe attached patch should solve this problem (applies probably to all versions of drupal).
It just preserves the trailing space in case the signature marker is found (i.e., trailing space is only removed, if it is not preceded by "^--"; otherwise there must be at least two spaces).
See http://tools.ietf.org/html/rfc3676#section-4.3
Comment #4
Waltemath commentedResubmitted patch.
Comment #5
tyr commentedPatch (#4) works, thanks Waltemath!
Comment #6
webchickNeed tests for this.
Comment #8
Tor Arne Thune commentedStill a valid issue in Drupal 7.0.
Comment #9
wojtha commentedSimilar (but not duplicate) of #1328696: Problem with _drupal_wrap_mail_line and attachment files
Comment #10
naxoc commentedHere are two patches: One with test only and one with fix and test.
Comment #11
justafishThe tests in #10 do not run for me locally through the UI as DrupalUnitTestCase isn't available (I think)
I've added a test for drupal_wrap_mail removing a whitespace character before a newline and one for an incorrect signature.
Comment #12
Tor Arne Thune commented@justafish: #1563620: All unit tests blow up with a fatal error.
That's why you can't run unit tests locally without failures at the moment.
Comment #13
justafishRerolled against latest HEAD.
Comment #14
blakehall commentedTests passing, and the functionality looks good to me. Marking RTBC
Comment #15
catchPatch and tests both look good. Committed/pushed to 8.x, moving to 7.x for backport.
Comment #16
sunWhoopsie... MailTest was not exactly the right test class ;)
There's a DrupalHtmlToTextTest class somewhere else, and we need to move the new test methods over there :) The MailTest class' main purpose is to serve as an actual Mail system implementation for tests.
Comment #17
superspring commentedMoving tests to DrupalHtmlToTextTest class.
Comment #18
sunExcellent, thanks! :)
Comment #19
superspring commentedSame patch as above but for D7.
Marked as do not test until the D8 patch has been commited, then the D7 patch can be considered.
Comment #20
sunFWIW, #17 came back green.
Comment #21
webchickCommitted and pushed #17 to 8.x. Thanks!
Marking down to 7.x for #19.
Comment #22
naxoc commentedI downloaded the patch from #19, removed the "do-not-test", and uploaded it again for the bot.
Comment #23
sunComment #24
David_Rothstein commentedCommitted to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/5808159
Moving to Drupal 6 for backport.
Comment #25
superspring commentedAttached is a D6 version of the patch.