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 473198 - evolution should ignore signature when checking for missing attachments
evolution should ignore signature when checking for missing attachments
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Composer
2.22.x (obsolete)
Other Linux
: Normal enhancement
: ---
Assigned To: Tomas Popela
Evolution QA team
evolution[composer] evolution[signatu...
: 491327 (view as bug list)
Depends on: 522784
Blocks:
 
 
Reported: 2007-09-03 14:37 UTC by Pedro Villavicencio
Modified: 2014-06-30 14:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Ignore signatures. (2.04 KB, patch)
2008-05-20 18:24 UTC, Johnny Jacob
committed Details | Review

Description Pedro Villavicencio 2007-09-03 14:37:32 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 :-("
Comment 1 André Klapper 2007-09-04 00:51:21 UTC
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
Comment 2 Tim Ansell 2007-09-16 06:03:19 UTC
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.
Comment 3 Tobias Mueller 2008-03-24 03:44:55 UTC
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"?
Comment 4 Tobias Mueller 2008-03-24 05:10:05 UTC
s/last/first/
Comment 5 Johnny Jacob 2008-03-24 11:39:42 UTC
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 ! 
Comment 6 Tobias Mueller 2008-03-24 14:53:33 UTC
(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.
Comment 7 Johnny Jacob 2008-03-25 05:08:30 UTC
(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 :)
Comment 8 Johnny Jacob 2008-05-20 18:24:41 UTC
Created attachment 111244 [details] [review]
Ignore signatures.
Comment 9 Matthew Barnes 2008-05-20 18:41:52 UTC
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.
Comment 10 Johnny Jacob 2008-05-20 18:50:53 UTC
*** Bug 491327 has been marked as a duplicate of this bug. ***
Comment 11 Johnny Jacob 2008-05-20 19:06:01 UTC
Thanks Matthew. Patch corrected and committed. r35521.

Bug still valid for HTML signatures.
Comment 12 Matthew Barnes 2008-12-02 04:20:00 UTC
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.
Comment 13 Milan Crha 2009-08-05 21:13:53 UTC
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
Comment 14 Tobias Mueller 2009-10-07 12:32:37 UTC
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?
Comment 15 Matthew Barnes 2009-10-07 14:31:43 UTC
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.
Comment 16 André Klapper 2011-11-07 15:27:15 UTC
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!
Comment 17 André Klapper 2011-11-07 15:32:41 UTC
Garr. Ignore the last comment.
Comment 18 Tomas Popela 2014-06-30 14:08:04 UTC
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