Open
Bug 1093035
Opened 11 years ago
Updated 3 years ago
Long subject lines prevent saving and printing (If Subject text length exceeds 510 bytes or 510 chars, Save As, Print, silently fails on Linux)
Categories
(Thunderbird :: General, defect)
Tracking
(Not tracked)
NEW
People
(Reporter: bugzilla, Unassigned)
References
Details
(Whiteboard: ["Save As" part was fixed by bug 675448])
User Story
1. "Save As" part was fixed by bug 675448 (2015-01-30, Target Milestone :Thunderbird 38.0) Solution : keep file name less than 256 characters, first part + "..." + last part So it's applicable to other bugs for similar symptom.
Attachments
(1 file)
|
6.16 KB,
text/plain
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:33.0) Gecko/20100101 Firefox/33.0
Build ID: 20141013200110
Steps to reproduce:
Receive an email with a subject line of 256 characters or more (251 for saving). Problem tested on linux only.
Actual results:
Nothing. Can't save the email without changing the filename. Can't print email.
Expected results:
Email should be saved/printed
Comment 2•11 years ago
|
||
Confirm that in TB31.2.0, Windows 7 Professional 64-bit, a message with a subject line of 256 characters fails to save (File|Save As) and fails to print.
Saving gives a "path too long" error. Printing to a real printer fails for undetermined reason. Printing to the adobe pdf virtual printer succeeds, but only because it redacts the filename and forces you to enter a new one (which it will presumably validate anyway.)
Flags: needinfo?(chris.ramsden)
Comment 3•11 years ago
|
||
Sorry, I didn't specify what we need is a linux test. (I think we should expected it to fail on windows, no?)
Comment 4•11 years ago
|
||
TB 31.2.0, LMDE on Linux version 3.11-2-amd64 (debian-kernel@lists.debian.org) (gcc version 4.8.1 (Debian 4.8.1-10) ) #1 SMP Debian 3.11.8-1 (2013-11-13)
Pretty much the same. Save As|File silently fails. Printing to PDF or postscript is a non-issue, as it prompts for a file name. I don't have a real hardware printer to test with.
Comment 5•11 years ago
|
||
In recent Linux, default of NAME_MAX / PATH_MAX looks as follows.
> http://serverfault.com/questions/9546/filename-length-limits-on-linux
> #define NAME_MAX 255 /* # chars in a file name */
> #define PATH_MAX 4096 /* # chars in a path name including nul */
IIUC, NAME_MAX is also "including terminating null".
In Linux, "chars" of NAME_MAX / PATH_MAX may be "ascii chars". i.e. maybe "bytes" instead of "number of unicode characters".
IIRC, "generated file name from Subject" was shorten to less than 128 chars because of limitation by Win, although I'm not sure.
On Linux, what file name is shown in "Save dialog" when length of Subject text = 251 characters?
What vlaue is used for NAME_MAX / PATH_MAX in your Linux?
By the way, see bug 1093860 for issue of "PATH_MAX=4096 looks ignored by Tb on Linux".
Comment 6•11 years ago
|
||
(In reply to Chris Ramsden from comment #2)
> Confirm that in TB31.2.0, Windows 7 Professional 64-bit, a message with a
> subject line of 256 characters fails to save (File|Save As) (snip)
Length limittion of Win is diferent from Linux.
> http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx
> Default of MAX_PATH in Win = 260 unicode chars, including terminating null.
> "File name length limit under a directory" depends on file system.
If "length of file name part of your Save As request" is longer than 255, full path length(".eml" is usually added) surely exeedes 260 chars.
Even if same issue such as "generated file name from Subject is too long for OS" is involved in your Win case too, please open separate bug for your Win case, in order to avoid confusion and chaos in this bug for issue on Linux.
Comment 7•11 years ago
|
||
Quick check result with Tb 31.2.0 on Win.
(1) Subject text length = 254 ascii char
Save As dialog : "<--- 254 chars--->.eml "was shown as preset file name
(2) Subject text length = 305 ascii char
Save As dialog : Nothing is offered as file name by Tb (preset file name is null)
Logic for "generating file name from subject" in Tb looks to have "limit around 256" chars or bytes.
It looks OS independent.
On Linux, if file name is manually shortened at Save As dialog, and if "full path length of saved .eml file" is longer than 256(bytes, or unicode chars), is "Save As" of a mail successful?
Comment 8•11 years ago
|
||
If length of "file name generated from Subject by Tb" is 251, length with ".eml" is 255.
If NAME_MAX=255 includes terminating null, <-251 byres->.eml exceeds NAME_MAX limit in Linux.
On Linux, do you see your problem when "file name generated from Subject by Tb" = 250?
Comment 9•11 years ago
|
||
(In reply to bugzilla from comment #0)
> (251 for saving).
To Bug opener : does it implies "if 250 or less for saving, no problem on Linux"?
| Reporter | ||
Comment 10•11 years ago
|
||
(In reply to WADA from comment #9)
> To Bug opener : does it implies "if 250 or less for saving, no problem on
> Linux"?
If the name with ".eml" appended sums up to more than 255 characters, the operation fails. The limit on linux filesystem filenames is 255 bytes.
Comment 11•11 years ago
|
||
(In reply to bugzilla from comment #10)
> If the name with ".eml" appended sums up to more than 255 characters, the operation fails.
> The limit on linux filesystem filenames is 255 bytes.
Quick check result #2 with Tb 31.2.0 on Win.
(3) Subject text length = 255 ascii char
Save As dialog : "<--- 255 chars--->.eml" was shown as preset file name, total file name length=258
(4) Subject text length = 256 ascii char
Save As dialog : Nothing is offered as file name by Tb (preset file name is null)
It looks that Tb's logic doesn't count length of ".eml".
It may be caused by confusion due to "file name and file extension is independent in 8.3 format of Win" or by "file extension is hiddne by default in Windows Explorer".
Comment 12•11 years ago
|
||
Mail folder file for test. Crafted mails are contained.
Subject:[SP]<---50 bytes ascii---> + 4 * { [SP]<---50 bytes ascii---> }
=> [SP]=s space=0x20, 254 bytes subject is pretty easily generated.
Some chars are added or reduced from this.
From: L-???@z.z.z (where ??? is length of subject)
Save this file as .../Mail/Local Folders/Test, restart Tb, "Repair Folder" of the "Test" folder.
Comment 13•11 years ago
|
||
FYI.
Subject header of all test mails starts with "Subject:[SP]<---50Bytes--->[SP]P23456789A1234~".
In Print Preview, "Heading" was always shown as "<---50Bytes--->[SP]P234... mailbox:// ~ ".
Tb's logic for "Shorten subject text", which I saw in the past, was perhaps logic for this kind of work.
Comment 14•11 years ago
|
||
(In reply to bugzilla from comment #10)
> If the name with ".eml" appended sums up to more than 255 characters, the operation fails.
> The limit on linux filesystem filenames is 255 bytes.
Question to avoid my misunderstanding.
Is problem/symptom/phenomenon on Linux is following?
(i) If "length of subject text"<=250("length with .eml"<=254), Save As is successful, as far as "full path length"<4096.
(ii) If 251<="length of subject text"<=255(255<="length with .eml"), Save As fails silently.
(iii) If 256<="length of subject text", file name is not offered by Tb at Save As dialog.
(iv) If NAME_MAX value of Linux is increased from 255, for example, NAME_MAX=384, problem of (ii) won't occur in Linux.
| Reporter | ||
Comment 15•11 years ago
|
||
(In reply to WADA from comment #14)
> Is problem/symptom/phenomenon on Linux is following?
> (i) If "length of subject text"<=250("length with .eml"<=254), Save As
> is successful, as far as "full path length"<4096.
> (ii) If 251<="length of subject text"<=255(255<="length with .eml"),
> Save As fails silently.
> (iii) If 256<="length of subject text", file name is not offered by Tb at
> Save As dialog.
> (iv) If NAME_MAX value of Linux is increased from 255, for example,
> NAME_MAX=384, problem of (ii) won't occur in Linux.
(i)+(ii) yes
(iii) no, filename is present in Save As dialog, saving silently fails.
(iv) should be, can't test it.
The bigger problem is that printing isn't possible and fails also silently. In the Save As dialog there is at least the possibility to change the filename.
Comment 16•11 years ago
|
||
(In reply to bugzilla from comment #15)
> (In reply to WADA from comment #14)
> > Is problem/symptom/phenomenon on Linux is following?
> > (i) If "length of subject text"<=250("length with .eml"<=254), Save As
> > is successful, as far as "full path length"<4096.
> > (ii) If 251<="length of subject text"<=255(255<="length with .eml"),
> > Save As fails silently.
> > (iii) If 256<="length of subject text", file name is not offered by Tb at
> > Save As dialog.
> > (iv) If NAME_MAX value of Linux is increased from 255, for example,
> > NAME_MAX=384, problem of (ii) won't occur in Linux.
>
> (i)+(ii) yes
> (iii) no, filename is present in Save As dialog, saving silently fails.
In Linux, "length limitation in shown file name(excluding .eml)" looks longer than one in Win.
When Subject text length = 512, 1024, 4095, 4096, ..., is file name shown at Save As dilalog?
> (iv) should be, can't test it.
Changing NAME_MAX is so hard job in Linux?
> The bigger problem is that printing isn't possible and fails also silently.
> In the Save As dialog there is at least the possibility to change the filename.
Before analysis of tough "printing case"("what kind of string is used at where" etc. is still unknown), analysis of "Save As case"(used file name is visible) is pretty important, isn't it?
For printing case. Following may be helpful.
Getting File Access Monitor Tool log for Tb's file access when print is requested for "mail with Subjet text length=510".
Anywy, confirming per comments from bug opener nd comment posters.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Long subject lines prevent saving and printing → Long subject lines prevent saving and printing (If Subject text length exceeds 510 bytes or 510 chars, Save As, Print, silently fails on Linux)
Comment 17•10 years ago
|
||
This looks like a duplicate of bug 675448
Comment 18•10 years ago
|
||
bug 675448 is originally report for Win case, even if additional "Me too" comments refers to other OSes.
I believe "phenomenon on OS who has 255 bytes max" and "phenomenon on OS who doesn't have 255 bytes max" is better processed separately.
Even if "limit around 255 bytes in Thunderbird" will be removed by this bug, problem like bug 675448 can't be resolved if OS has "255 bytes max" limitton, although solution like "shorten filename if Subject is longer than a limit" will be aplicable to both cases..
Comment 19•10 years ago
|
||
Hmmm... it doesn't matter at all what the bug was originally reported for.
If these two bugs are going to get fixed with the same patch, one of them will need to get marked as duplicated, so that we don't waste the time of two developers possibly working on the same thing...but i think i don't have to explain you how bmo works...
Personally, i just want the bug fixed, i don't care over what bug number :)
Comment 20•10 years ago
|
||
Reporter of this bug says "limit is 510 bytes or 510 chars" but reporter of bug 1093860 says "limit is 255 chars".
Which is correct?
"255 character in Unicode(utf-16) if local is utf-8" and " 510 bytes in ascii if locale is sigle byte code"?
Comment 21•10 years ago
|
||
http://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits
So for linux usually 255 bytes. That seems to be 255 chars when the locale is utf8 (which I guess is pretty much everyone).
Comment 22•9 years ago
|
||
The "save as" case was fixed in bug 675448.
I'll have to test printing when I'm connected to a printer
Updated•9 years ago
|
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•