Defect #15716

Scraped emails include CSS from HTML emails

Added by Deoren Moor about 4 years ago. Updated over 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Email receiving
Target version:3.1.0
Resolution:Fixed Affected version:2.4.1

Description

I'm not sure how many others are encountering this behavior, but when replying to an email notification (and making sure to remove all text from the body) the CSS for HTML emails is included as if it were written by the user. In this particular case I responded to a notification using the default mail client from iOS 7.

Example reply:

Sure, that will work.

body {
font-family: Verdana, sans-serif;
font-size: 0.8em;
color:#484848;
}
h1, h2, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin: 0px; }
h1 { font-size: 1.2em; }
h2, h3 { font-size: 1.1em; }
a, a:link, a:visited { color: #2A5685;}
a:hover, a:active { color: #c61a1a; }
a.wiki-anchor { display: none; }
fieldset.attachments {border-width: 1px 0 0 0;}
hr {
width: 100%;
height: 1px;
background: #ccc;
border: 0;
}
span.footer {
font-size: 0.8em;
font-style: italic;
}

Our environment:

  Redmine version                2.4.1.stable.12325
  Ruby version                   1.8.7-p352 (2011-06-30) [i686-linux]
  Rails version                  3.2.15
  Environment                    production
  Database adapter               MySQL

reply_to_the_notification_15176.png (109 KB) Go MAEDA, 2014-07-07 14:27

reply_from_ios.png (106 KB) Jean-Philippe Lang, 2015-06-16 10:55

html_reply_from_ios.png (130 KB) Jean-Philippe Lang, 2015-06-16 11:07

redmine_3.0.3+r14313_replies_from_iPhone4_iOS_7.1.2.png (51.1 KB) Deoren Moor, 2015-06-16 15:50


Related issues

Related to Redmine - Defect #19740: "Truncate emails after one of these lines" setting is not... Closed
Related to Redmine - Defect #20311: Task from Email - Styles in task text Closed

Associated revisions

Revision 14315
Added by Jean-Philippe Lang over 2 years ago

Remove style tags from html body (#15716).

History

#1 Updated by Deoren Moor almost 4 years ago

Is there any additional information that I can provide? Any tips/config changes that I can try?

Thanks.

#2 Updated by Go MAEDA over 3 years ago

I cannot reproduce with Redmine 2.5.1/iOS 7.1.1. Does this problem still occur?

#3 Updated by Deoren Moor over 3 years ago

Hi,

Thanks for the reply. Yes, it occurs every time I send an email from an iOS device. I have not yet tested with the newly released Redmine 2.5.2, but I will do so and post back with my results.

#4 Updated by Deoren Moor over 3 years ago

Deoren Moor wrote:

Yes, it occurs every time I send an email from an iOS device.

To be clear, my OP had the key ingredient:

I responded to a notification using the default mail client from iOS 7.

I did not see the behavior when sending in the initial report, but when replying to an email that is when I noticed it. It's also worth noting that we have our Redmine installation configured to send HTML emails and not plaintext emails.

It probably doesn't make a difference, but I sent the test email and test reply from an iOS 7.1.2 device.

#5 Updated by Go MAEDA over 3 years ago

No problem with iOS 7.1.2 and notification from www.redmine.org. What happens when you reply to the notification from www.redmine.org?

#6 Updated by Deoren Moor over 3 years ago

I just replied, but I noticed that the address I was replying to is '', so I suspect it will not end up here.

Is there any additional information I can supply about our setup?

#7 Updated by Deoren Moor over 3 years ago

Sounds like someone else is having the problem too (maybe they just posted to the wrong ticket): #10929#note-4

#8 Updated by Deoren Moor over 3 years ago

Digging back through our Redmine system I found that the earliest example of this happening is June 24, 2013. We would have been running whatever Redmine version was current at the time. If I'm not mistaken, that would be version 2.3.1.

#9 Updated by Deoren Moor over 2 years ago

Note: this is still a problem as of Redmine 3.0.2. We see it often for current versions of Mac OS X and iOS. I'm still using iOS 7 on a work device, and I see the behavior with it as well.

#10 Updated by Toshi MARUYAMA over 2 years ago

  • Related to Defect #19740: "Truncate emails after one of these lines" setting is not working added

#11 Updated by Deoren Moor over 2 years ago

Still a problem as of Redmine 3.0.3 + back-ported changes in r14313.

#12 Updated by Jean-Philippe Lang over 2 years ago

Works fine for me when replying from iOS 8.3 with current trunk (including r14313), here is what I get in Redmine:

Can you send a test reply to my email address () so I can try to reproduce?

#13 Updated by Jean-Philippe Lang over 2 years ago

My reply from iOS contains a plain text part and a html part so Redmine chooses the plain text part, with the result above.
If I manually remove the plain text part before submitting the email to Redmine, here is was I get:

#14 Updated by Deoren Moor over 2 years ago

Jean-Philippe Lang wrote:

Works fine for me when replying from iOS 8.3 with current trunk (including r14313), here is what I get in Redmine:

...

Can you send a test reply to my email address () so I can try to reproduce?

Thanks for the reply and for testing.

I was a bit confused when I saw your example, so I took a closer look at Apple Mail on my iPhone 4 w/iOS 7.1.2 and found that the Increase Quote Level was set to Off. I tried with it both Off and On and got the same results. This is with me doing nothing more than adding my reply at the top and hitting send.

I'm going to forward the emails as an attachment (from Outlook) to the personal email address you've listed. If you'd rather have them in a different format please let me know and I'll provide them in whichever format you wish. Thanks again for looking into this.

#15 Updated by Deoren Moor over 2 years ago

Just sent two samples, one with Increase Quote Level On and another with it set to Off. Both appear to give the same results:

redmine_3.0.3+r14313_replies_from_iPhone4_iOS_7.1.2.png

In the past the CSS wasn't collapsed and looked more like what was shown in the OP.

#16 Updated by Jean-Philippe Lang over 2 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 3.1.0
  • Resolution set to Fixed

This should be fixed by r14315, style tags inside html body were not removed. Please reopen if you still experience the problem after this.

#17 Updated by Toshi MARUYAMA over 2 years ago

  • Related to Defect #20311: Task from Email - Styles in task text added

#18 Updated by Dmitriy Ermakov over 2 years ago

Good day!
I am from task http://www.redmine.org/issues/20311

I apply r14315 (http://www.redmine.org/projects/redmine/repository/revisions/14315).
But now i receive styles in my tasks(

P {margin-top:0;margin-bottom:0;}

test

#19 Updated by Toshi MARUYAMA over 2 years ago

Dmitriy Ermakov wrote:

I apply r14315 (http://www.redmine.org/projects/redmine/repository/revisions/14315).
But now i receive styles in my tasks(

P {margin-top:0;margin-bottom:0;}

test

You need to apply r14313 at first.

Also available in: Atom PDF