GNOME Bugzilla – Bug 473198
evolution should ignore signature when checking for missing attachments
Last modified: 2014-06-30 14:08:04 UTC
This bug has been filled here: https://bugs.launchpad.net/ubuntu/+source/evolution/+bug/136948 "version: 2.11.91-0ubuntu1 evolution prompted me that I might have forgotten an attachment. This is _really_ nice, however it doesn't ignore my signature which has a company-wide disclaimer about "scanning attachments for viruses" which always trigger the alert so unfortunately I've had to disable this useful feature :-("
so, what to do? proposals? where's the complaint? :-) you can remove the word "attachment" from the list of keywords under edit -> plugins -> attachment reminder
I too have run into this problem (signature has a word in it which triggers the attachment checking code). I propose that the attachment check ignores the signature part of the message when searching for words which may indicated an attachment.
This makes sense. Maybe the plugin could ignore everything after the last "-- \n" it finds. I don't know about HTML signatures. Does Evo make a "-- <br/>\n"?
s/last/first/
Hmmm .. Not that simple :-) . Can't look for a "-- \n" pattern as it may not be a signature at all. HTML Signatures doesn't have a "--" Probably have to write some code to ignore signature when extracting text from composer. e_msg_composer_get_raw_message_text is the place to play !
(In reply to comment #5) > Hmmm .. Not that simple :-) . Can't look for a "-- \n" pattern as it may not be > a signature at all. > Well, there is a RFC which defines that "-- \n" is the spacer between the body and a signature. If somebody writes "-- \n" on purpose, it's cleary not evos problem. Hence it should really be sufficient to strtr() for "-- \n" and ignore the rest. > HTML Signatures doesn't have a "--" > I bet Evo puts kind of a spacer between the body and the HTML signature. And I bet, that it's not "-- \n" but rather "-- \n<br/>" or the like. I just bricked my evo, so I can't check for myself. Oh, I just recognized bug 522783, which indicates, that Evo *doesn't* add a "-- \n<br/>" in front of a HTML Signature. Thus depending this bug on bug 522784 > Probably have to write some code to ignore signature when extracting text from > composer. e_msg_composer_get_raw_message_text is the place to play ! > As mentioned above: searching for the signature delimiter should be sufficient, as it's the standard^tm.
(In reply to comment #6) > (In reply to comment #5) > > Hmmm .. Not that simple :-) . Can't look for a "-- \n" pattern as it may not be > > a signature at all. > > > Well, there is a RFC which defines that > "-- \n" Yep yep! you are right ! > > HTML Signatures doesn't have a "--" > > > I bet Evo puts kind of a spacer between the body and the HTML signature. And I > bet, that it's not "-- \n" but rather "-- \n<br/>" or the like. I just bricked > my evo, so I can't check for myself. > > Oh, I just recognized bug 522783, which indicates, that Evo *doesn't* add a "-- > \n<br/>" in front of a HTML Signature. Thus depending this bug on bug 522784 > Thanks ! That should make this easier :)
Created attachment 111244 [details] [review] Ignore signatures.
I don't think GLib has a g_strcmp() function. But in double checking that I did discover g_strcmp0(), which looks way handy (handles NULL arguments gracefully). Patch looks fine otherwise.
*** Bug 491327 has been marked as a duplicate of this bug. ***
Thanks Matthew. Patch corrected and committed. r35521. Bug still valid for HTML signatures.
You know, rather than trying to locate the signature by parsing the content, I think there's a better way. GtkHtml lets you tag paragraphs with metadata that only the program can see. Evolution marks the signature paragraph with a "signature" tag, and uses it in various places in the composer. Example: data = gtkhtml_editor_get_paragraph_data (editor, "signature"); if (data != NULL && *data == '1') { gtkhtml_editor_run_command (editor, "text-default-color"); gtkhtml_editor_run_command (editor, "italic-off"); } You might be able to use this to iterate over the paragraphs in the message and decide whether to scan each for attachment-related keywords (i.e. don't scan if it has a "signature" tag). Should work for both plain text and HTML.
Hmm, I like the idea about paragraphs, but I didn't find these: a) how to iterate through paragraphs b) how to get only the paragraph text, preferably as a plain text c) how does it work with tables (you know, more complex HTML messages) Note that you can put signature also to the up and quote below. It seems to me that this bug shouldn't depend on bug #522784, but on bug #522783
Matt, do you have any ideas on Milans problems raised in comment #13? If not, then this might be better discussed on e-h :-) Johnny, are you actually working on this?
No idea off-hand. I would suggest not spending too much time on this until we're using WebKit's DOM bindings, otherwise we'll have to solve this all over again.
Thanks for taking the time to report this bug. Without a stack trace from the crash it's very hard to determine what caused it. Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
Garr. Ignore the last comment.
Introduce method that returns body inner text without signature text. Fixed with commit [0] in master branch for Evolution 3.13.4+. [0] - https://git.gnome.org/browse/evolution/commit/?id=b73adeb5e0456cba8a6592d16941e7911d81d5d4