Download & Extend

Newlines stripped from emails sent via listhandler

Project:Listhandler
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

On a Drupal 6 installation (Fedora Linux, Postfix SMTP, Dovecot SMTP) where we wanted integration with forums and the mailman mailing list we have used the following modules:

* forums
* mailhandler
* listhandler
* mailman_manager

One of the problems we have encountered is newlines being stripped away from forum posts which were sent by listhandler to the email address associated with the mailman mailing list. Other posts which were handled through mailman did not have the newline issue.

The problem seems to be the call to drupal_html_to_text() function.

Using the function only when HTML is detected seems to solve this problem. For example:

$body = (stripos($edit['comment'], 'p>')) ? drupal_html_to_text($edit['comment']) : $edit['comment'];

Looking for p> is a rough way to search for opening or closing paragraph tags which are likely to be in HTML content.

If paragraph tags are detected, convert the HTML to text. If not, simply make the assignment to $body.

This was tested with listhandler in "fancy" and "standard" mode but "fancy" was retained for our purposes to better match the newlines input in the emails.

I don't know if a similar assignment is advisable for the previous line where $subject is assigned.

AttachmentSize
listhandler.module.patch512 bytes

Comments

#1

Status:active» needs review

#2

I have the same problem.

1) listhandler in standard mode: newlines stripped
2) listhandler in fancy mode: newlines there, but seems like something in the headers is wrong (empty line after subject:)

I use fck editor with wysiwyg. Tried nearly all possible combinations with/without fck, filters, etc.
I am not able to apply a patch, so I have to wait...

To see what I mean by 2), I love to send you some example. I am not sure to post it here with all mailadresses open.

Patric