After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 586461 - Remove signature also from HTML formatted emails on reply
Remove signature also from HTML formatted emails on reply
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.30.x (obsolete)
Other All
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[composer] evolution[signatu...
Depends on:
Blocks:
 
 
Reported: 2009-06-20 11:37 UTC by Oded Arbel
Modified: 2011-06-20 08:43 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
proposed evo patch (3.87 KB, patch)
2010-03-29 15:04 UTC, Milan Crha
none Details | Review
patch for Evolution 2.28.3 (3.87 KB, text/plain)
2010-04-05 01:03 UTC, Oded Arbel
  Details

Description Oded Arbel 2009-06-20 11:37:04 UTC
Please describe the problem:
Evolution has a (great) feature where when replying to a message, it removes the signature of the sender of the original message (keeping only the discussion being replied to, with minimum amount of noise).

This feature works great when replying to a text message, but when replying to an HTML formatted message Evolution does not remove the signature.


Steps to reproduce:
1. Set a signature for the current account which starts with a line that has the text "-- " (notice the space after the double dash).
2. Send yourself an email in HTML format.
3. Reply to the email


Actual results:
The signature will remain in the reply

Expected results:
The signature from the original e-mail should not be seen in the reply

Does this happen every time?
Yes

Other information:
Following the same steps but with a text email, and the signature will not be shown in the reply.
Comment 1 Matthew Barnes 2009-06-20 13:33:17 UTC
Perhaps a dupe of bug #522783.
Comment 2 Oded Arbel 2009-06-20 23:28:45 UTC
Bug #522783 is related as it talks about signature handling in HTML, but its for the other side - signature generated by Evolution. This bug on the other hand is about signatures received by Evolution.
Comment 3 Milan Crha 2010-03-26 20:22:24 UTC
Maybe not expected by a user, but from a developer's point of view it cannot remove the signature, because the delimiter between the text body and the signature is defined as "-- \n", but in the HTML version of the message is most likely "-- <BR>" or even better "-- <BR>\n\r" as a signature delimiter, not talking about possible embedding into some table or such. This can be doable, but probably not trivial to have it done really correctly (I'm thinking of stripping all from "-- <BR>" and then go back and close all HTML tags which are pair tags, but doesn't have it's close tag, which is kinda tricky, and which also filtering system in evolution doesn't support, as it can only filter forward, not backward. (These are CamelMimeFilter-s, not filters for incoming/outgoing messages.)

Nonetheless, I believe it's still valid for 2.30.0.
Comment 4 Oded Arbel 2010-03-26 23:26:47 UTC
Thanks. If its possible to workout how that there's a line that renders through HTML as "-- " and remove everything after that, for 2.30, then that would be great. The feature shouldn't be bullet-proof perfect - if it work for most simple cases then that's good enough for me :-).

I don't think you need to worry too much about unclosed tags - I'm not sure how GTKHTML handles such cases, but generally HTML renderers (like in browsers) are supposed to be very forgiving to things like unclosed tags.
Comment 5 Milan Crha 2010-03-29 15:04:44 UTC
Created attachment 157388 [details] [review]
proposed evo patch

for evolution;

This makes it work fine for me. Note I changed there also one other bug, as for some emails it didn't strip signature in them (I took an email where it worked fine, "Edit as New Message" in Evolution, saved it, and it stopped working).
Comment 6 Oded Arbel 2010-03-30 18:40:20 UTC
Thanks for the patch - will this apply to 2.28 or do I need trunk for that?
Comment 7 Milan Crha 2010-03-30 18:51:40 UTC
it should work for 2.28 too, only file location is in evo/mail, not in evo/em-format. Apply it by hand, if necessary, though the code didn't change there much, I would suppose.
Comment 8 Oded Arbel 2010-04-03 14:23:38 UTC
I'm trying to apply the patch on Ubuntu's 2.28.3 evolution, but it depends on several other changes from the 2.29 branch, which I haven't managed to track all of them yet. I'll let you know if I make more progress.
Comment 9 Oded Arbel 2010-04-05 01:03:11 UTC
Created attachment 157935 [details]
patch for Evolution 2.28.3

This patch had applied against Evolution 2.28.3 (its only minor changes from Milan's patch).

After testing, I can say that it works mostly as advertised, with the following caveats:
1. If the signature separator has any formatting applied to it (like color which I put in by mistake on my sig) then Evolution won't remove the signature. I don't think this is a serious issue.
2. When removing the sig from an HTML email, the text of the signature is removed but not the signature container (the block that the composer marks with a dotted border when entering it). This leaves a couple of lines and that weird box at the end of the quoted email.
Comment 10 Milan Crha 2010-04-06 11:06:40 UTC
yeah, it's the thing with kept opened tags in HTML. I'm afraid that not all composers are putting signatures into tables or such, so it's hard to tell whether we can do this, not loosing any information from it.
Comment 11 Oded Arbel 2010-04-06 13:10:47 UTC
Well, I won't lose any sleep over it - your current patch works well enough for me, thanks :-)
Comment 12 Milan Crha 2011-03-09 16:45:37 UTC
I forgot of this bug, I'm sorry. I was going to fix it and I realized I fixed it already. But the previous fix wasn't completely correct. I committed a modified version of it, which is adapted to actual camel API and which fixes things I do not think were 100% correct. Like it's checking for plain-text signature always now, and the change in "start" pointer wasn't right at all.

Created commit eef2191 in evo master (2.91.92+)
Comment 13 Oded Arbel 2011-06-20 07:30:45 UTC
Thanks. This works well in Evolution 3.0. Any chance seeing this in 2.32 as well? - in my main system where I do email I'm using Fedora 14 because I'm having problem with the stability of GNOME 3.
Comment 14 Milan Crha 2011-06-20 08:43:05 UTC
There is no official Gnome-wide update planned for the 2.32 version, as far as I know, though David Woodhouse is taking care of gnome-2-32 branches for evolution-related products, thus if he is willing to backport it, then probably yes. I'm CC'ing David here.