Closed Bug 1403544 Opened 8 years ago Closed 3 months ago

HTML mail signature is not removed on reply

Categories

(Thunderbird :: Message Compose Window, defect)

56 Branch
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 43829

People

(Reporter: bjoernv, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 Build ID: 20170824000000 Steps to reproduce: 1) Setup a HTML signature - Edit->Account Settings->Account->Default Identity: Signature text: [x] Use HTML Signature (text field): <i>HTML signature<i> 2) Compose a new mail with this signature and send to me - use HTML format (Options->Delivery Format->Rich Text (HTML) Only 3) Reply to this email Actual results: The signature is used two times (also see screenshot): On 9/27/17 2:45 PM, Test User wrote: > > Test > -- > HTML signature -- HTML signature Expected results: I expect, that the HTML signature is removed from the quoted text on reply. This works, if the initial mail uses only text mode, but not in HTML mode.
This works for me in a Daily, haven't tried TB 56 beta. Does this happen when you disable all add-ons? See Help menu.
I tested again with the latest nightly thunderbird-58.0a1.en-US.linux-x86_64.tar.bz2. I created a new profile and followed the procedure in initial post. I have no add-ons in the new profile. The result is still the same like in initial post.
Sorry, I can reproduce it now. I must have tested it without the <i></i> so the message was downgraded to plaintext and it worked as you stated in comment #0.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Already not working in TB 45 and 52, so not a recent regression. I've looked for the code that removes the signature but haven't found it so far. The only code looking for a signature I can see is in nsMsgCompose::SetIdentity() and that's not run for replies, only for changing identities and switching signatures. Needs further looking into, right now, I don't have the time. Aceman, do you know where the code is that removes signatures from plaintext replies but not HTML replies?
Flags: needinfo?(acelists)
Summary: HTML mail signature is not remove on reply → HTML mail signature is not removed on reply
(In reply to Jorg K (GMT+2) from comment #4) > Already not working in TB 45 and 52, so not a recent regression. > > I've looked for the code that removes the signature but haven't found it so > far. The only code looking for a signature I can see is in > nsMsgCompose::SetIdentity() and that's not run for replies, only for > changing identities and switching signatures. Needs further looking into, > right now, I don't have the time. > > Aceman, do you know where the code is that removes signatures from plaintext > replies but not HTML replies? The code may be here: https://dxr.mozilla.org/comm-central/source/mail/components/compose/content/MsgComposeCommands.js // Ignore signature (html compose mode). let sigs = mailBodyNode.getElementsByClassName("moz-signature"); for (let i = sigs.length - 1; i >= 0; i--) { sigs[i].remove(); } In HTML mode, Thunderbird uses the CSS class "moz-signature" for signatures. There is also a helper function /** * Small helper function to check whether the node passed in is a signature. * Note that a text node is not a DOM element, hence .localName can't be used. */ function isSignature(aNode) { return ["DIV","PRE"].includes(aNode.nodeName) && aNode.classList.contains("moz-signature"); }
Nope. The first one you mention is of the attachment reminder and the second one doesn't remove any signatures. Trust me, I'm the compose peer here, I've looked at it for an hour and didn't find it. I've been thinking about this. Why is it a good thing to remove signatures? So if you answer an e-mail from someone else, do you expect their signature to be removed as well? Why should the program modify HTML quotes? I'm inclined to turn the thing around and leave the signature for plaintext replies was well ... if I can find the code that removes it ;-(
OK, thanks for the looking more deeply in the code. I haven't used the debugger to analyze the code and I also do not know a preferred strategy to debug Thunderbird (C++, Javascript, Rust ...). I only used the search function and found the wrong code. My main argument for fixing the signature-remove code is, that I found, that Thunderbird has much better functions for handling signatures compared to other popular mail clients: - Thunderbird uses the "-- " separator for signatures (this feature is a bit controversial in case of HTML signatures; some blog articles describe how to avoid this in Thunderbird for HTML signatures) - Thunderbird marks HTML signatures with the "moz-signature", which makes it theoretically easy to remove HTML signatures - Thunderbird has code to remove signatures on reply - configuration of signatures is flexible and user-friendly In comparison Outlook solves many signature related functions wrong - Outlook configuration is WYSIWYG, but the results may look different on different clients - Outlook does not understand common CSS features (e.g. position:absolute is ignored/removed) - Outlook translates HTML to HTML with own extensions, which makes mails (including the signature code) up to 300% bigger - Outlook does not remove signatures at all on reply - Outlook does not use the "-- " separator One big practical problem with HTML signatures is, that most mail clients do not use the CSS class "moz-signature" to mark the signature and do not use "-- " for HTML signatures. Solving the signature-removing problem for all other clients in Thunderbird is therefore nearly impossible. But it can be solved within a Thunderbird user group. I also have two arguments against leaving text signatures intact. If signatures with the "-- " marker are left intact in the middle of a mail, the next mail client may remove the signatures including other text on reply. I also think, that signatures in replies in the middle of a text disturb the reader. In mailing lists the user easily can find the signatures of the other users in the mail thread. In normal mail usage this is not always possible, e.g. when a user A sends a mail with his signature to user B and user B uses the reply function to forward the mail to user C. If the signature of user A is removed on the second step, then C has no chance to get it. But using the reply function to forward mails is also a bit special.
I probably found the correct code for stripping the signature in text/plain format now. There are two parsers mimetpla (for text/plain) and mimetpfl (for text/plain with format=flowed). Both parsers have the option text->mStripSig which is true by default and can be changed by the preference "mail.strip_sig_on_reply". The following code in mailnews/mime/src/mimetpla.cpp and mailnews/mime/src/mimetpfl.cpp strips the signature if the mail is a reply: if (!(exdata->isSig && quoting && tObj->mStripSig)) { // ... } Since the preference "mail.strip_sig_on_reply" is only used in the two text/plain parsers and in test cases, I think that stripping of HTML signatures is currently not implemented. I used the following source code version: 56.0b4 mailnews/mailnews.js mailnews/mime/src/mimetpfl.cpp mailnews/mime/src/mimetpfl.h mailnews/mime/src/mimetpla.cpp mailnews/mime/src/mimetpla.h mail/test/mozmill/composition/test-reply-signature.js
Your comment #8 is most likely spot-on :-) I suspected that MIME was doing the stripping but gave up before I found it. Now all you need to add to your repertoire is quoting DXR permalinks ;-) https://dxr.mozilla.org/comm-central/rev/706e5fdd301201b23e96be9826b7e5b953d11776/mailnews/mime/src/mimetpfl.cpp#464 https://dxr.mozilla.org/comm-central/rev/706e5fdd301201b23e96be9826b7e5b953d11776/mailnews/mime/src/mimetpla.cpp#422 > I think that stripping of HTML signatures is currently not implemented. That's what I figured when I couldn't find it. I haven't had time to study your comment #7 in detail, but briefly reading it I can't see answers to my questions from comment #6: So if you answer an e-mail from someone else, do you expect their signature to be removed as well? Why should the program modify HTML quotes?
Flags: needinfo?(acelists)
I'm using SeaMonkey Suite (Ver 2.49.1) which incorporates Firefox and Thunderbird. It still suffers from this problem when someone composes an e-mail in HTML with a signature file, when that message is replied to, the signature file is not deleted but is also quoted. Previous discussion, either in the mozilla.support.seamonkey or mozilla.test newsgroups, has suggested that the problem is that the sig-delimiter (-- ) is with-in the HTML envelop so cannot be removed in the reply rather than being added *AFTER* the closure of the HTML envelope. Is this still the case?? And, if so, is it an easy operation to take the sig-delimiter (when a sig-file is required/included) out of the HTML envelope??
Severity: normal → S3
Duplicate of this bug: 1912745
No longer duplicate of this bug: 1912745
Status: NEW → RESOLVED
Closed: 3 months ago
Duplicate of bug: 43829
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: