GNOME Bugzilla – Bug 586461
Remove signature also from HTML formatted emails on reply
Last modified: 2011-06-20 08:43:05 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.
Perhaps a dupe of bug #522783.
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.
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.
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.
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).
Thanks for the patch - will this apply to 2.28 or do I need trunk for that?
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.
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.
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.
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.
Well, I won't lose any sleep over it - your current patch works well enough for me, thanks :-)
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+)
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.
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.