Closed
Bug 320102
Opened 19 years ago
Closed 17 years ago
File - Save As - Template menu item does nothing for an existing message in Local folders
Categories
(Thunderbird :: Mail Window Front End, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 3
People
(Reporter: Aleksej, Assigned: Bienvenu)
References
Details
(Keywords: verified1.8.1.8)
Attachments
(4 files, 4 obsolete files)
(deleted),
patch
|
mscott
:
superreview+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mscott
:
superreview+
mscott
:
approval1.8.1.8+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mscott
:
superreview+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mscott
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: 2005120115
Tried restarting Fx some times, checked the folder name in account settings.
Reproducible: Always
Steps to Reproduce:
1. Select an existing message (I did in Drafts and Inbox folders in Local Folders)
2. Choose File-Save as-Template
3. Look into the Local Folders - Templates folder (if it exists)
Actual Results:
Nothing appeared in the Local Folders - Templates folder.
Expected Results:
The message should appear in the folder as a template.
Debian GNU/Linux testing (Etch)
Comment 1•19 years ago
|
||
This worked on WinXP when using a templates folder on the imap server and for one in the local folders. IMAP required (I think) and Local Folders required that the templates folder be created first. IMAP was slow to show the templates but they did work.
So this bug may be Linux only.
Reporter | ||
Updated•19 years ago
|
Version: unspecified → 1.5
Comment 2•19 years ago
|
||
Aleksej, are you using IMAP? If so, this is a dupe of bug 216262.
Reporter | ||
Comment 3•19 years ago
|
||
No IMAP. Only one POP3 account, and then one NNTP account.
Comment 4•19 years ago
|
||
->new Seeing this to on 1.5/linux, I assume you only mean mesages that already exist, not when you create a new message. Doesn't work in tb 1.0.x either.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: File - Save As - Template menu item does nothing → File - Save As - Template menu item does nothing for existing message
Reporter | ||
Comment 5•19 years ago
|
||
Can't recheck in 1.5 now, but in 1.0, yes, and in 1.5 AFAIR yes.
Comment 6•19 years ago
|
||
I can confirm this is linux only. On windows 1.5rc it works fine.
Comment 7•19 years ago
|
||
Under Windows 2000, 1.5.0.2, this bug is not occurring; but with 2a1-0523,
3a1-0529, I see Save As | Template failing for all messages, in particular those in a POP Inbox. (xref bug 176567 comment 8 -- In Seamonkey 1.5-0518,
I'm not seeing it.)
Comment 8•18 years ago
|
||
Under Windows XP Professional SP2 Spanish I have the same problem with Thunderbird 1.5.0.5 (20060719), es-ES localized build. When I install the program the "Templates" folder doesn't exist. The "Save as template" option does nothing.
If I first chose "Edit as new", then "Save as template", the "Templates" folder is finally created. However, it remains empty.
Reporter | ||
Updated•18 years ago
|
OS: Linux → All
Reporter | ||
Comment 9•18 years ago
|
||
Still there with version 2 beta 1 (20061121)/Linux
Reporter | ||
Updated•18 years ago
|
Summary: File - Save As - Template menu item does nothing for existing message → File - Save As - Template menu item does nothing for an existing message
Reporter | ||
Comment 10•18 years ago
|
||
Also on version 2 beta 1 (20061121)
Reporter | ||
Comment 12•18 years ago
|
||
And on Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2pre) Gecko/20070216 Thunderbird/2.0pre ID:2007021603
Updated•18 years ago
|
QA Contact: front-end
Reporter | ||
Comment 13•18 years ago
|
||
And version 2.0.0.4pre (20070514) and version 3.0a1 (20070511)
Comment 14•17 years ago
|
||
The root cause is that on Linux (actually UNIX) each line is ended with '\n' instead of '\r\n' and IMAP server may not accept this obsolete syntax according to the RFC2822.
On MS Windows, each line is ended by '\r\n', so there is no such issue on MS Windows platform.
Comment 15•17 years ago
|
||
Attachment #271008 -
Flags: review?(mscott)
Reporter | ||
Comment 16•17 years ago
|
||
(In reply to comment #14)
> The root cause is that on Linux (actually UNIX) each line is ended with '\n'
> instead of '\r\n' and IMAP server
This bug doesn't need IMAP accounts to happen.
> may not accept this obsolete syntax according to the RFC2822.
[off-topic]o_O XT performance issues in 2001? Or just poorly working compatibility?[/off-topic]
Comment 17•17 years ago
|
||
Comment on attachment 271008 [details] [diff] [review]
replace standalone '\n' with '\r\n'
bouncing over to David.
Attachment #271008 -
Flags: review?(mscott) → review?(bienvenu)
Comment 18•17 years ago
|
||
(In reply to comment #16)
> (In reply to comment #14)
> > The root cause is that on Linux (actually UNIX) each line is ended with '\n'
> > instead of '\r\n' and IMAP server
>
> This bug doesn't need IMAP accounts to happen.
>
> > may not accept this obsolete syntax according to the RFC2822.
>
> [off-topic]o_O XT performance issues in 2001? Or just poorly working
> compatibility?[/off-topic]
>
Can you tell me how to re-produce the bug without an IMAP account? Thanks
Assignee | ||
Comment 19•17 years ago
|
||
Comment on attachment 271008 [details] [diff] [review]
replace standalone '\n' with '\r\n'
yuck, I'd much rather fix this in memory, instead of on disk, i.e., as we're uploading the lines.
Reporter | ||
Comment 20•17 years ago
|
||
(In reply to comment #18)
> Can you tell me how to re-produce the bug without an IMAP account? Thanks
Not exclusive, just the StR I've just tried (version 3.0a1pre (2007070803) Linux):
1. Create a new profile.
2. Create a POP e-mail account
3. Create a message, choose "Send later", close
4. Create "Inbox" under Local folders, move the message there
5. Select the message
6. File→Save As→Template
Actual results: none
Comment 21•17 years ago
|
||
(In reply to comment #19)
> (From update of attachment 271008 [details] [diff] [review])
> yuck, I'd much rather fix this in memory, instead of on disk, i.e., as we're
> uploading the lines.
>
I think we can't do this in memory because the mail can be very large
Assignee | ||
Comment 22•17 years ago
|
||
You can do it a line or buffer at a time...I'll try to get to this in a bit.
Attachment #271008 -
Attachment is obsolete: true
Attachment #271008 -
Flags: review?(bienvenu)
Comment 23•17 years ago
|
||
Attachment #271627 -
Flags: review?(bienvenu)
Attachment #271627 -
Attachment is obsolete: true
Attachment #271627 -
Flags: review?(bienvenu)
Comment 24•17 years ago
|
||
Attachment #271630 -
Flags: review?(bienvenu)
Assignee | ||
Comment 25•17 years ago
|
||
I forgot this is imap, where we need to know how big the message is before we start appending it. It seems like the save as template code should make sure we have CRLF line endings, just like the FCC (copy to sent folder) code does. Let me go see why that code works, assuming it does.
Assignee | ||
Comment 26•17 years ago
|
||
What happens without your patch if you edit a message as new, and then send it, with an imap fcc folder? Does the message get correctly appended to the imap sent folder?
The code that I was thinking about that fixes the line endings for copying messages to an imap folder is the code that gets called when you copy a local message to an imap folder, not a template or fcc msg.
Assignee | ||
Comment 27•17 years ago
|
||
Brian, does this fix work for you? If I'm understanding the problem correctly, it's only happening with the plain text compose window (not the html compose window) which is why it must not be that common. If so, the simple fix is to make the plain text compose window always generate CRLF's, like we're already doing for html.
Comment 28•17 years ago
|
||
(In reply to comment #27)
> Created an attachment (id=271735) [details]
> possible alternate fix
>
> Brian, does this fix work for you? If I'm understanding the problem correctly,
> it's only happening with the plain text compose window (not the html compose
> window) which is why it must not be that common. If so, the simple fix is to
> make the plain text compose window always generate CRLF's, like we're already
> doing for html.
>
I tried the patch, but it doesn't work for me. I think it's unrelated to composing.
The following are steps I used to reproduce the bug:
1. start thunderbird with an IMAP account ( I use Sun IMAP server)
2. select an e-mail in INBOX
3. select File->Save As -> Template
expected result:
The selected e-mail should be save in Template folder
actual result:
The mail is not saved in the Template folder.
Assignee | ||
Comment 29•17 years ago
|
||
oh, duh. Does editing a plain text message as new, and saving that as an imap template cause the same problem?
Assignee | ||
Comment 30•17 years ago
|
||
I suspect the problem for the file save as template case (is this an imap message you're saving?) is that the message is in the memory cache, and thus we don't realize that we should be converting to canonical line endings, which is how, in general, we avoid this line ending problem in the first place - see nsIMsgMessageUrl.canonicalLineEnding, which gets set to true when we want the saving code to end lines with CRLF.
I tried saving a local message as an imap template, and that failed badly, trunk and 2.0 branch, which is a separate issue.
Assignee | ||
Comment 31•17 years ago
|
||
Brian, if you could indulge me, and see if this fixes the problem you were seeing saving an imap message as a template, that would be helpful.
What this patch does is prevent save as template from going through the memory cache, if you're on a platform with a one char line terminator.
Comment 32•17 years ago
|
||
(In reply to comment #31)
> Created an attachment (id=271950) [details]
> fix saving imap message as a template
>
> Brian, if you could indulge me, and see if this fixes the problem you were
> seeing saving an imap message as a template, that would be helpful.
>
David, the patch doesn't work. The following is what I did:
1. build thunderbird with the both patches
2. start TB
3. compose a new e-mail and send it to myself
4. select the new e-mail in the inbox
5. save it as a template
I think the root cause is that each line sent to the IMAP server in "append" command (the command used when saving as a template) should be ended with CRLF no matter what platform TB runs on
Assignee | ||
Comment 33•17 years ago
|
||
OK, this fixed it for me, and is much nicer than my previous patch, in that it still allows us to use the disk or memory cache. This replaces the previous patch, though I think the save as draft from the compose window patch is still needed for that case.
Comment 34•17 years ago
|
||
David, I tried your patch, it doesn't work with my IMAP account.
The following is the log I dumped by setting NSPR_LOG_MODULES=IMAP:5
10[9738198]: 9738fe8:mail-apac.sun.com:S-Templates:SendData: 9 append "Templates" (\Seen \Draft) {1279+}^M
10[9738198]: 9738fe8:mail-apac.sun.com:S-Templates:SendData: Return-path: <Brian.Lu@Sun.COM>
Received: from fe-apac-05.sun.com ([192.18.19.176])
by sedge2-mail1.singapore.sun.com
(Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006))
with ESMTP id <0JL3008SXLD11T90@sedge2-mail1.singapore.sun.com> for
brian.lu@sun.com; Fri, 13 Jul 2007 11:22:13 +0800 (SGT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
10[9738198]: 9738fe8:mail-apac.sun.com:S-Templates:SendData: ^M
10[9738198]: ReadNextLine [stream=8a35844 nb=37 needmore=0]
10[9738198]: 9738fe8:mail-apac.sun.com:S-Templates:CreateNewLineFromSocket: 9 NO Message contains bare newlines^M
I think each line sent to the IMAP server should be ended with CRLF (i.e ^M)
Assignee | ||
Comment 35•17 years ago
|
||
If you set a breakpoint in nsMsgSaveAsListener::OnDataAvailable, are we adding a CRLF newline, or a LF newline?
Comment 36•17 years ago
|
||
(In reply to comment #35)
> If you set a breakpoint in nsMsgSaveAsListener::OnDataAvailable, are we adding
> a CRLF newline, or a LF newline?
>
David, sorry, I missed a line in your patch. I re-added the patch and it works for me now.
Assignee | ||
Comment 37•17 years ago
|
||
Comment on attachment 271630 [details] [diff] [review]
Not using temporary file to do the translation
marking obsolete
Attachment #271630 -
Attachment is obsolete: true
Attachment #271630 -
Flags: review?(bienvenu)
Assignee | ||
Updated•17 years ago
|
Attachment #271735 -
Flags: superreview?(mscott)
Assignee | ||
Comment 38•17 years ago
|
||
Comment on attachment 272053 [details] [diff] [review]
[checked in]fix saving imap message as draft
Thx for diagnosing this problem and testing my patch, Brian.
Someday we might go with your approach but I'd like to avoid the extra overhead if possible :-)
Attachment #272053 -
Flags: superreview?(mscott)
Updated•17 years ago
|
Attachment #272053 -
Flags: superreview?(mscott) → superreview+
Updated•17 years ago
|
Attachment #271735 -
Flags: superreview?(mscott) → superreview+
Assignee | ||
Comment 39•17 years ago
|
||
Comment on attachment 271735 [details] [diff] [review]
[checked in]possible alternate fix
want to bake this on the trunk, but we should consider this for the next .0x release.
Attachment #271735 -
Attachment description: possible alternate fix → [checked in]possible alternate fix
Attachment #271735 -
Flags: approval1.8.1.6?
Assignee | ||
Comment 40•17 years ago
|
||
Comment on attachment 272053 [details] [diff] [review]
[checked in]fix saving imap message as draft
want to let this bake on trunk, but getting on radar for 2.0.0.6
Attachment #272053 -
Attachment description: fix saving imap message as draft → [checked in]fix saving imap message as draft
Attachment #272053 -
Flags: approval1.8.1.6?
Assignee | ||
Comment 41•17 years ago
|
||
fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 42•17 years ago
|
||
No luck with version 3.0a1pre (2007072003) on Linux.
Note that the problem is with saving using the 3-pane window menu.
Assignee | ||
Comment 43•17 years ago
|
||
Aleksej, my guess is that your problem is unrelated to the issues Brian and I have been working on. I suspect your problem has something to do with us not knowing where your templates folder is. Do you have multiple accounts? Have you looked in all of them? Are you using the global inbox? Does anything appear on the error console when you do this?
Comment 44•17 years ago
|
||
Aleksej, which protocol do you use IMAP or POP3?
If you use IMAP, can you do the following for us?
1. open an xterm
2. export NSPR_LOG_FILE=/tmp/imap.log
3. export NSPR_LOG_MODULES=IMAP:5
4. /usr/bin/thunderbird
5. until you see the problem, quit from thunderbird
6. attach the imap.log here
Thanks
Reporter | ||
Comment 45•17 years ago
|
||
version 3.0a1pre (2007072203)
POP3. The log file remains empty.
The bug happens:
1. create a POP3 account with Global Inbox
2. start a new message and choose Send Later (the message is in Unsent now)
3. create Inbox folder if it doesn't exist
(optionally) create Templates folder
4. Move the message from step 2 into Inbox
5. Select Inbox, select the message in the message list
6. File → Save As → Template
Results:
If the Templates folder exists (after restart it will anyway), it is empty.
Oh. It looks like it doesn't work in Local folders. It works if I choose a separate folder tree for the account, and save the message there. It doesn't work for the same message under Local folders then, too.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Summary: File - Save As - Template menu item does nothing for an existing message → File - Save As - Template menu item does nothing for an existing message in Local folders
Comment 46•17 years ago
|
||
Aleksej, can you set NSPR_LOG_MODULES=POP3:5 and try again? Thanks
Reporter | ||
Comment 47•17 years ago
|
||
No change:
fxtest@chaos:/home/fb/3/mz/tb/trunk/tr2007072303$ env|grep NSPR
NSPR_LOG_MODULES=POP3:5
NSPR_LOG_FILE=/dev/shm/imap.log
fxtest@chaos:/home/fb/3/mz/tb/trunk/tr2007072303$ ls -al /dev/shm/imap.log
-rw-r--r-- 1 fxtest fxtest 0 2007-07-24 13:15 /dev/shm/imap.log
Assignee | ||
Comment 48•17 years ago
|
||
Yes, I'm pretty sure Aleksej's problem has nothing to do with pop3 or imap, and just has to do with us not knowing where the templates folder is. I don't think it has anything to do with the message your saving either - it's strictly an identity/profile/account issue.
Assignee | ||
Comment 49•17 years ago
|
||
function SaveAsTemplate(uri, folder)
{
if (uri) {
var identity = getIdentityForServer(folder.server);
messenger.saveAs(uri, false, identity, null);
}
}
I think this code simply doesn't work for the global inbox/local folders. It's the code that's invoked for file | save as template, when a message is selected. I'll dig a little more.
Assignee | ||
Comment 50•17 years ago
|
||
this is trunk-only fallout from nsIFileSpec - we need to clone the file to get the file size updated. Also, there's a little bit of fallout from the changes to save attachments automatically. This only affects selecting a local message in the thread pane and picking save as template when your template folder is IMAP.
Attachment #273786 -
Flags: superreview?(mscott)
Updated•17 years ago
|
Attachment #273786 -
Flags: superreview?(mscott) → superreview+
Assignee | ||
Updated•17 years ago
|
Attachment #273786 -
Attachment description: fix trunk-only regression saving a message as imap template → [checked in]fix trunk-only regression saving a message as imap template
Assignee | ||
Comment 51•17 years ago
|
||
finally, deal with the case that we can't get the identity for the message from the account key. I made a helper routine to get the best identity for a msg hdr, and made that code, as a fallback, iterate over all the identities, if it couldn't find an identity for the server.
Attachment #274175 -
Flags: superreview?(mscott)
Updated•17 years ago
|
Attachment #274175 -
Flags: superreview?(mscott) → superreview+
Assignee | ||
Updated•17 years ago
|
Attachment #274175 -
Attachment description: fix identity problem → [checked in]fix identity problem
Reporter | ||
Comment 52•17 years ago
|
||
Works with version 3.0a1pre (2007073103) now.
- The Templates folder is created after restart, not right after saving the template. The created folder then contains the template.
- In case the account has its own separate tree, the Templates folder is created under the account tree, not Local folders.
Assignee | ||
Comment 53•17 years ago
|
||
marking fixed
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Comment 54•17 years ago
|
||
can someone test bug 331876?
it might be fixed as well, but my local folder settings are host ATM.
Updated•17 years ago
|
Attachment #272053 -
Flags: approval1.8.1.7? → approval1.8.1.7+
Comment 56•17 years ago
|
||
verified 1.8.1.8 using Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.8pre) Gecko/20070927 Thunderbird/2.0.0.7pre Mnenhy/0.7.5.666 ID:2007092703
Keywords: fixed1.8.1.8 → verified1.8.1.8
Comment 57•17 years ago
|
||
Comment on attachment 271735 [details] [diff] [review]
[checked in]possible alternate fix
David, is this approval request still valid or did this get addressed by subsequent patches in this bug which landed on the 1.8.1.8 branch already.
Assignee | ||
Comment 58•17 years ago
|
||
Comment on attachment 271735 [details] [diff] [review]
[checked in]possible alternate fix
no, I think this request isn't valid anymore...
Attachment #271735 -
Flags: approval1.8.1.8?
Updated•17 years ago
|
Target Milestone: --- → Thunderbird 3
You need to log in
before you can comment on or make changes to this bug.
Description
•