First Last Prev Next    No search results available
Details
: Forward text message results in double header
Bug#: 25097
: smarttemplate4
: General
Status: RESOLVED
Resolution: FIXED
: PC
: Windows 7
: unspecified
: P2
: major
: ---

:
:
:
:
:
  Show dependency tree - Show dependency graph
People
Reporter: gessel@blackrosetech.com <gessel@blackrosetech.com>
Assigned To: Axel Grude <axel.grude@gmail.com>
:

Attachments
Attempt at a fix (245.90 KB, application/x-xpinstall)
2012-08-21 12:08, Axel Grude
no flags Details
test version 24 (246.72 KB, application/x-xpinstall)
2012-08-23 05:36, Axel Grude
no flags Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2012-08-21 07:51
With the latest update of Smart Template 4 (0.7.2 - 0.8.0) in Thunderbird 14 on
Windows 7/x64 when I forward a message (but not when I reply - that works fine)
I get a double header.  The header as formatted by SmartTemplate and the full
header from Thunderbird like this:

-------- Forwarded Message --------
Subject: Mulberry-discuss Digest, Vol 15, Issue 15
From: mulberry-discuss-request@lists.mulberrymail.com
To: mulberry-discuss@lists.mulberrymail.com
Sent: Sun, 28 Oct 2007 21:00:53 -0500 +0300

-------- Original Message --------
Return-Path: <mulberry-discuss-bounces@lists.mulberrymail.com>
X-Original-To: myemail@myserver.com
Delivered-To: myemail@myserver.com
Received: from mulberrymail.com (piper.mulberrymail.com [151.201.22.177])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client
certificate requested) by claudel.blackrosetech.com (Postfix) with ESMTP id
E26B72E04D for <gessel@blackrosetech.com>; Sun, 28 Oct 2007 19:01:01 -0700
(PDT)
Received: from piper.mulberrymail.com (localhost.localdomain [127.0.0.1]) by
mulberrymail.com (8.13.6/8.13.6) with ESMTP id l9T20uDs015393; Sun, 28 Oct 2007
21:00:57 -0500
From: mulberry-discuss-request@lists.mulberrymail.com
Subject: Mulberry-discuss Digest, Vol 15, Issue 15
To: mulberry-discuss@lists.mulberrymail.com
Reply-To: mulberry-discuss@lists.mulberrymail.com
Date: Sun, 28 Oct 2007 21:00:53 -0500
Message-ID:
<mailman.2415.1193623253.783.mulberry-discuss@lists.mulberrymail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-BeenThere: mulberry-discuss@lists.mulberrymail.com
X-Mailman-Version: 2.1.8
Precedence: list
List-Id: <mulberry-discuss.lists.mulberrymail.com>
List-Unsubscribe:
<http://lists.mulberrymail.com/mailman/listinfo/mulberry-discuss>,
<mailto:mulberry-discuss-request@lists.mulberrymail.com?subject=unsubscribe>
List-Archive: <http://lists.mulberrymail.com/archives/mulberry-discuss>
List-Post: <mailto:mulberry-discuss@lists.mulberrymail.com>
List-Help:
<mailto:mulberry-discuss-request@lists.mulberrymail.com?subject=help>
List-Subscribe:
<http://lists.mulberrymail.com/mailman/listinfo/mulberry-discuss>,
<mailto:mulberry-discuss-request@lists.mulberrymail.com?subject=subscribe>
Sender: mulberry-discuss-bounces@lists.mulberrymail.com
Errors-To: mulberry-discuss-bounces@lists.mulberrymail.com
X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME 
autolearn=disabled version=3.1.1
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on 
piper.mulberrymail.com
------- Comment #1 From Axel Grude 2012-08-21 08:36:23 -------
(In reply to comment #0)
> With the latest update of Smart Template 4 (0.7.2 - 0.8.0) in Thunderbird 14 on
> Windows 7/x64 when I forward a message (but not when I reply - that works fine)
> I get a double header.  The header as formatted by SmartTemplate and the full
> header from Thunderbird like this:

Just some questions:
Is this the part you are getting twice?

> -------- Forwarded Message --------
> Subject: Mulberry-discuss Digest, Vol 15, Issue 15
> From: mulberry-discuss-request@lists.mulberrymail.com
> To: mulberry-discuss@lists.mulberrymail.com
> Sent: Sun, 28 Oct 2007 21:00:53 -0500 +0300

Do you use the option 

[x] Disable thunderbird default quote header 

for forwarding?

Finally: Is this happening in HTML or plain text mode?
------- Comment #2 From gessel@blackrosetech.com 2012-08-21 09:13:24 -------
I get the headers just as I pasted them in - the nice compact header followed
by the very extended verbose header from Tbird:


-------- Original Message --------
.
.
.
piper.mulberrymail.com



The [x] disable thunderbird default quote header box is checked (I double
checked).

It is plain text mode (the One True Way to use email).

The extended header started appearing after the most recent update.  The exact
same template and settings worked fine a version ago.  

Oddly, if I use SmartTemplate for reply, it works fine - just forward comes out
odd.  For example, forwarding the notification from Bugzilla results in:


-------- Forwarded Message --------
Subject: [smarttemplate4] [Bug 25097] Forward text message results in double
 header
From: bugzilla-daemon@mozdev.mozdev.org
To: gessel@blackrosetech.com
Sent:  Tuesday, August 21, 2012 18:36:24 GMT+0300 AST

-------- Original Message --------
Return-Path: <www@mozdev.mozdev.org>
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
claudel.blackrosetech.com
X-Spam-Level: 
X-Spam-Status: No, score=-2.1 required=1.0 tests=AWL,BAYES_00,
RCVD_IN_DNSWL_LOW autolearn=disabled version=3.2.5
X-Original-To: gessel@blackrosetech.com
Delivered-To: gessel@blackrosetech.com
Received: from mozdev.mozdev.org (mozdev.mozdev.org [140.211.166.81]) by
claudel.blackrosetech.com (Postfix) with ESMTP id 173162E051 for
<gessel@blackrosetech.com>; Tue, 21 Aug 2012 08:36:26 -0700 (PDT)
Received: by mozdev.mozdev.org (Postfix, from userid 80) id 921A2844B0; Tue, 21
Aug 2012 08:36:24 -0700 (PDT)
From: bugzilla-daemon@mozdev.mozdev.org
To: gessel@blackrosetech.com
Subject: [smarttemplate4] [Bug 25097] Forward text message results in double
header
X-Bugzilla-Reason: Reporter
X-Bugzilla-Type: newchanged
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: smarttemplate4
X-Bugzilla-Component: General
X-Bugzilla-Keywords: 
X-Bugzilla-Severity: major
X-Bugzilla-Who: axel.grude@gmail.com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: axel.grude@gmail.com
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields: 
In-Reply-To: <bug-25097-24665@https.www.mozdev.org/bugs/>
References: <bug-25097-24665@https.www.mozdev.org/bugs/>
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
Message-Id: <20120821153624.921A2844B0@mozdev.mozdev.org>
Date: Tue, 21 Aug 2012 08:36:24 -0700 (PDT)
X-File-To: INB
------- Comment #3 From Axel Grude 2012-08-21 10:45:15 -------
(In reply to comment #2)
> I get the headers just as I pasted them in - the nice compact header followed
> by the very extended verbose header from Tbird:

Okay - if I understand correctly somehow the complete Header of the Mail gets
pasted into the body of the Email, after the Header composed by smartTemplate4.

Very peculiar. we have a way of showing the complete Header in the error
console, but it should not actually be inserted into the _email_ itself.
------- Comment #4 From gessel@blackrosetech.com 2012-08-21 10:53:02 -------
That does sound like the problem.  Perhaps I have a corrupted prefs file if
nobody else is seeing it.  I can't be the only one using plain text...
------- Comment #5 From Axel Grude 2012-08-21 11:12:27 -------
(In reply to comment #4)
> That does sound like the problem.  Perhaps I have a corrupted prefs file if
> nobody else is seeing it.  I can't be the only one using plain text...
> 

Obviously you are the only one who tested it (forwarding in plain text) ;-)

I was able to reproduce it by simply forwarding a newsgroup mail. Bug accepted,
expect a patch shortly.
------- Comment #6 From Axel Grude 2012-08-21 11:18:46 -------
(In reply to comment #4)
> That does sound like the problem.  Perhaps I have a corrupted prefs file if
> nobody else is seeing it.  I can't be the only one using plain text...
> 

Ok, I found the answer - but you won't like it :S

The full header is currently inserted by Thunderbird _even if you disable
smartTemplate4_  ich double checked the code twice in the debugger and then
decided st4 wasn't actually putting that header in there. Disabled st4 and
voila complete header still in mail text. You have found a Thunderbird bug. I
will get on to the maildev group on IRC and ask them if there is a known
regression around this.
------- Comment #7 From Axel Grude 2012-08-21 11:36:43 -------
(In reply to comment #6)
> (In reply to comment #4)
> > That does sound like the problem.  Perhaps I have a corrupted prefs file if
> > nobody else is seeing it.  I can't be the only one using plain text...
> > 
> 
> Ok, I found the answer - but you won't like it :S
> 
> The full header is currently inserted by Thunderbird _even if you disable
> smartTemplate4_  ich double checked the code twice in the debugger and then
> decided st4 wasn't actually putting that header in there. Disabled st4 and
> voila complete header still in mail text. You have found a Thunderbird bug. I
> will get on to the maildev group on IRC and ask them if there is a known
> regression around this.
> 

Maybe a bit to fast setting this to INVALID, reopening it. Can you set View /
Headers to Normal?
------- Comment #8 From Axel Grude 2012-08-21 12:08:09 -------
Created an attachment (id=7346) [details]
Attempt at a fix

Here is an attempt to fix this - there is at least one caveat:

the very first line "On Thursday, November 5, 2009 1:29:03 AM UTC-5, xyz
wrote:" cannot be safely removed.

There might be attachments that influence the header in a way that might make
it impossible to safely delete just the header information - in text mode there
is no dedicated container for this, so the original code (and now this patched
version) searches for 2 consecutive <br> (line breaks) in order to stop
deleting headers. You can imagine that this may wreak havoc if there are other
extensions (or the behavior of thunderbird itself) changes in a way that these
are not present anymore - this can lead to the complete original email or at
least the first quoted mail being deleted... so please test with caution.
------- Comment #9 From gessel@blackrosetech.com 2012-08-21 12:47:33 -------
Set view headers to normal and get

-------- Forwarded Message --------
Subject: Accidental Spills and Falls
From: Jameco Electronics <email@jamecoelectronics.messages1.com>
To: gessel@blackrosetech.com
Sent:  Tuesday, August 21, 2012 21:16:07 GMT+0300 AST

-------- Original Message --------
Subject:        Accidental Spills and Falls
Date:   Tue, 21 Aug 2012 18:16:07 +0000 (GMT)
From:   Jameco Electronics <email@jamecoelectronics.messages1.com>
Reply-To:       email@jamecoelectronics.messages1.com
To:     gessel@blackrosetech.com


Funny how Thunderbird's reply template is so different from the forward
template.  The internal reply template is quite acceptable:

-------- Original Message --------
Subject: Accidental Spills and Falls
From: Jameco Electronics <email@jamecoelectronics.messages1.com>
To: gessel@blackrosetech.com
Date: Tue Aug 21 2012 21:16:07 GMT+0300 (Arabic Standard Time)


It looks to me that everything between the first --- and the first <br><br> is
reliably the headers.  Any deletion would just happen to the quoted text, no? 
Not to the original message... would it?
------- Comment #10 From Axel Grude 2012-08-21 17:23:40 -------
(In reply to comment #9)
> 
> Funny how Thunderbird's reply template is so different from the forward
> template.  The internal reply template is quite acceptable:
> 
> -------- Original Message --------
> Subject: Accidental Spills and Falls
> From: Jameco Electronics <email@jamecoelectronics.messages1.com>
> To: gessel@blackrosetech.com
> Date: Tue Aug 21 2012 21:16:07 GMT+0300 (Arabic Standard Time)
> 
> 
> It looks to me that everything between the first --- and the first <br><br> is
> reliably the headers. Any deletion would just happen to the quoted text, no? 

> Not to the original message... would it?
> 

the  original message is also quoted text, unless you attach the message. I
think we can say it works for you on your system (with the extensions that you
have installed). But can one ever be sure?

So did the patch work for you?

:-)
------- Comment #11 From gessel@blackrosetech.com 2012-08-21 17:26:01 -------
Perfecto!

forward header with smarttemplate

-------- Forwarded Message --------
Subject: Mulberry-discuss Digest, Vol 15, Issue 15
From: mulberry-discuss-request@lists.mulberrymail.com
To: mulberry-discuss@lists.mulberrymail.com
Sent: Monday, October 29, 2007 05:00:53 GMT+0300 AST




Single header goodness and formatting flexibility achieved!

Nice programing, Axel!  Very impressive work and turn around time.  Now to the
real problem: why aren't people using plain text?  Clogging up the tubes with
HTML headers and font declarations...  kids these days.

Smarttemplate template to achieve this forwarded message header formatting
perfection, just in case anyone is looking:

-------- Forwarded Message --------
Subject: %subject%
From: %from%
To: %to%
Sent: %X:=sent%%datelocal% GMT%date_tz% %tz_name%


(And that was twice today we simultaneously committed: my first two bugzilla
mid-air collisions.)
------- Comment #12 From gessel@blackrosetech.com 2012-08-22 02:41:52 -------
Bummer - fix works for forwarding but not reply.    It seems to strip all the
<br> or <lf> (not sure)

SmartTemplate:

-------- Original Message --------
Subject: Mulberry-discuss Digest, Vol 15, Issue 15
From: mulberry-discuss-request@lists.mulberrymail.com
To: mulberry-discuss@lists.mulberrymail.com
Sent: Monday, October 29, 2007 05:00:53 GMT+0300 Arabic Standard Time> Send
Mulberry-discuss mailing list submissions to>      
mulberry-discuss@lists.mulberrymail.com> > To subscribe or unsubscribe via the
World Wide Web, visit>  
http://lists.mulberrymail.com/mailman/listinfo/mulberry-discuss> or, via email,
send a message with subject or body 'help' to> 
mulberry-discuss-request@lists.mulberrymail.com> > You can reach the person
managing the list at>       mulberry-discuss-owner@lists.mulberrymail.com> >
When replying, please edit your Subject line so it is more specific> than "Re:
Contents of Mulberry-discuss digest..."> > > Today's Topics:> >   


Thunderbird:



-------- Original Message --------
Subject: Mulberry-discuss Digest, Vol 15, Issue 15
From: mulberry-discuss-request@lists.mulberrymail.com
To: mulberry-discuss@lists.mulberrymail.com
Date: Mon Oct 29 2007 05:00:53 GMT+0300 (Arabic Standard Time)

> Send Mulberry-discuss mailing list submissions to
> 	mulberry-discuss@lists.mulberrymail.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.mulberrymail.com/mailman/listinfo/mulberry-discuss
> or, via email, send a message with subject or body 'help' to
> 	mulberry-discuss-request@lists.mulberrymail.com
> 
> You can reach the person managing the list at
> 	mulberry-discuss-owner@lists.mulberrymail.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Mulberry-discuss digest..."
> 
> 
> Today's Topics:
------- Comment #13 From Axel Grude 2012-08-23 05:36:47 -------
Created an attachment (id=7350) [details]
test version 24

Can you try this version. it is a bit more cautious removing brs and stuff. The
methods of the original extension were "fragile", I am switching to a "Less
fragile" mode, essentially replacing a "House of cards" with lego.
------- Comment #14 From Axel Grude 2012-08-23 06:20:10 -------
Marking this as fixed. If you still find other issues with this prerelease
version (such as weird behavior with removing line breaks), the please raise a
new bug.

First Last Prev Next    No search results available