Issues with incoming HTML emails

MedMan - December 17, 2008 - 12:15
Project:Mail Comment
Version:6.x-1.0-beta4
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I have Mail 2 Web working on a Trial Site using the 5.x dev version. The incoming emails from some people (but not all) are being uploaded by Mailhandler with some closing tags missing, most notably </div> This then breaks the page completely. (I am using the Roople Theme Tapestry) I'm not sure if this is a Mail to Web problem or a Mailhandler problem.

#1

MedMan - December 18, 2008 - 22:33
Title:Closing tags stripped out» Issues with incoming HTML emails

I have changed the title of this bug report so that it covers a number of problems I am having when the incoming email is in HTML format. I know I could solve them by switching to a plain text filter, but I want members to be able to included simple formatting like bold, italic etc.

I am using what I call 'Mailhandler HTML' on my input side (it allows only very basic formatting tags) and a Plain Text filter on my Simple Mail in Messaging/Notifications. (I know that sounds contradictory, but my managed sever (1&1) only has PHP 4 so I can't run PHPMailer)

I can send an initial post to a Forum using a dedicated email address in Mailhandler now that you have made this possible in the dev version. If this initial post is in HTML it is posted in formatted form as expected. Messaging/Notifications/Mail2Web distributes the copies of the message correctly and they arrive, of course, in Plain Text. The (((Demarcation Line))) appears in the correct place.

If a user replies in Plain Text all is well. The message is posted in the correct thread on the Forum and the Demarcation Line and everything below it are removed.

If a user replies with formatted text things go wrong - but what goes wrong depends upon the mail client used. If it is Thunderbird the message is posted in the correct place in formatted form, but the Demarcation Line and the quoted text are not stripped. Thunderbird wraps all of this in blockquote tags but it makes no difference whether I have those allowed in my Mailhandler Input Format or not - non of it is stripped.

If the mail client is Google Web Mail the Demarcation Line and quoted text are stripped but this also strips out the closing tags for the span and div tags that Google puts in above the Demarcation Line. It is these non-closed span or div (I suspect the div) tags that break the Theme Page. I can solve this problem by not allowing span and div in my filter.

#2

MedMan - December 24, 2008 - 09:58

The pasted text below shows how Thunderbird wraps up the (((Demarcation Line))) and quoted text in blockquote tags. I can only assume that this then hides them from the code that is supposed to strip them:

<blockquote
cite="mid:1.132.0.1230111895.28d7e18c48f2f909c156002afa4f441f@myca.org.uk"
type="cite">(((Message from CA Forums: Reply above this line to post a
comment)))
  <br>

#3

batje - July 2, 2009 - 12:10
Version:5.x-1.x-dev» 6.x-1.0-beta2

We have the same issue with HTML mails:

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal style='margin-bottom:12.0pt'>((( Reply ABOVE this LINE to
RESPOND to message )))<br>
<br>
</p>

is not recognized.

(sorry, forgot the code tags)

#4

Ian Ward - July 6, 2009 - 21:28

Yes, it looks like the line wrap is causing the problem. One workaround could be to shorten the length of the demarcation text, so it has less of a chance of breaking lines. I am thinking about a solution though I'm not sure how elegant it will be.

#5

Ian Ward - November 16, 2009 - 17:54
Project:Mail to Web» Mail Comment
Version:6.x-1.0-beta2» 6.x-1.0-beta4

Switch to mailcomment project. Mail2web is now known as "mailcomment" due to a trademark issue with the name mail2web.

 
 

Drupal is a registered trademark of Dries Buytaert.