Closed
Bug 73694
Opened 24 years ago
Closed 23 years ago
Incorrect date set on import of Eudora mail (sent messages only)
Categories
(MailNews Core :: Backend, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.0
People
(Reporter: thomas.swan, Assigned: cavin)
References
Details
(Keywords: testcase, Whiteboard: imp-mail)
Attachments
(5 files, 1 obsolete file)
(deleted),
text/plain
|
Details | |
(deleted),
text/plain
|
Details | |
(deleted),
text/plain
|
Details | |
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
bugzilla
:
review+
sspitzer
:
superreview+
asa
:
approval+
|
Details | Diff | Splinter Review |
The import utility incorrectly sets the date on sent mail from both normal
folders and sent mail.
This occurs in both the out.mbx and any folder containing a message "moved" from
the out.mbx into itself (mailboxes containg both sent and received messages.)
Problem:
Eudora does not set a Date: header on sent messages, but instead relies upon the
From ???@??? Thu Oct 26 09:50:32 2000
separator between messages.
Solution:
Pull the date from the ???@??? line and override that value with the date pulled
from the Date: header if it exists. It still provides a method for a linear
pass on the import.
Comment 1•24 years ago
|
||
not a movemail bug.
we need an import bug category.
Assignee: adam → sspitzer
Component: Movemail → Mail Back End
Reporter | ||
Comment 2•24 years ago
|
||
Reporter | ||
Comment 3•24 years ago
|
||
Reporter | ||
Comment 4•24 years ago
|
||
Reporter | ||
Comment 5•24 years ago
|
||
Assignee | ||
Comment 6•24 years ago
|
||
I've got a fix for #57125, and I see what's going on.
taking this bug from seth.
Assignee: sspitzer → cavin
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 7•24 years ago
|
||
Thanks
Reporter | ||
Comment 9•23 years ago
|
||
http://www.jjminer.org/eud2mbox/ might be able to give some help in
understanding the Eudora mail format... The scripts there will convert a
Eudora format mailbox .mbx with the .toc file to the standard mbox format.
That in and of itself might be easier to deal with...
Comment 10•23 years ago
|
||
Marking nsbeta1 because the dates,even if they are in the Sent folder should be
correct.
Keywords: nsbeta1
Whiteboard: imp-mail
Updated•23 years ago
|
Updated•23 years ago
|
Target Milestone: --- → mozilla1.0
Assignee | ||
Comment 11•23 years ago
|
||
Parse and store the date info from the Eudora "From " lines and write out this
date header for Eudora msgs which do not contain any "Date:" header.
Comment 12•23 years ago
|
||
Comment on attachment 70999 [details] [diff] [review]
Proposed fix, v1
R=ducarroz
Comment 13•23 years ago
|
||
1)
it's safe to change the caps on these strings, because the other code that uses
it does strncasecmp(), right?
+static char *eudoraWeekDays[7] = {
+ "Mon",
+ "Tue",
+ "Wed",
+ "Thu",
+ "Fri",
+ "Sat",
+ "Sun"
+};
+
+static char *eudoraMonths[12] = {
+ "Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec"
+};
+
2)
is this change to ensure that tymStr is always null terminated? if so, please
add a comment to explain that. if not, what does this change do?
- char tymStr[8];
+ char tymStr[9];
PRBool tym = PR_FALSE;
PRBool remote = PR_FALSE;
PRBool from = PR_FALSE;
@@ -795,6 +823,7 @@
tymStr[6] = '0';
tymStr[7] = '0';
}
+ tymStr[8] = 0;
3)
+ // Generate the default date header in case we need it later when we
+ // write out headers. The header looks like "Date: Tue, 5 Feb 2002
23:05:04"
+ char str[64];
+ sprintf(str, "Date: %s, %2d %s %4d %s", eudoraWeekDays[weekDay-1], day,
eudoraMonths[month-1], year, tymStr);
+ defaultDate.Assign(str);
the code looks safe, but you should still do snprintf(str, 64, ...) to prevent
potential buffer over runs. at the least, switching to snprintf will prevent
us from having to re-examine this code when we do buffer overrun audits.
Assignee | ||
Comment 14•23 years ago
|
||
> it's safe to change the caps on these strings, because the other code that
> uses it does strncasecmp(), right?
>
Yes, that's correct.
> is this change to ensure that tymStr is always null terminated? if so,
> please add a comment to explain that. if not, what does this change do?
>
Yes, tymStr is always null terminated now because it's needed in the
PR_snprintf() call (easier to use if it's null terminated).
> the code looks safe, but you should still do snprintf(str, 64, ...) to
> prevent potential buffer over runs.
>
OK, it's changed.
Assignee | ||
Comment 15•23 years ago
|
||
Attachment #70999 -
Attachment is obsolete: true
Comment 16•23 years ago
|
||
Comment on attachment 71372 [details] [diff] [review]
Incorporated seth's comments.
sr=sspitzer
Here are two minor style comments. No need for a new patch, but please change
before you check in:
+// 64 bytes is plenty to hold the date header.
+#define DATE_STR_LEN 64
+ char date_header_str[DATE_STR_LEN];
+ PR_snprintf(date_header_str, DATE_STR_LEN, "Date: %s, %2d %s %4d %s",
eudoraWeekDays[weekDay-1], day, eudoraMonths[month-1], year, tymStr);
+ defaultDate.Assign(date_header_str);
1) instead of "str", do "date_header_str". "str" alone doesn't tell future
reads of the code much.
2) #define the constant, instead of having it twice.
Attachment #71372 -
Flags: superreview+
Comment 17•23 years ago
|
||
Comment on attachment 71372 [details] [diff] [review]
Incorporated seth's comments.
R=ducarroz
Attachment #71372 -
Flags: review+
Comment 18•23 years ago
|
||
Comment on attachment 71372 [details] [diff] [review]
Incorporated seth's comments.
a=asa (on behalf of drivers) for checkin to 1.0 trunk
Attachment #71372 -
Flags: approval+
Assignee | ||
Comment 19•23 years ago
|
||
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 20•23 years ago
|
||
*** Bug 139713 has been marked as a duplicate of this bug. ***
Updated•20 years ago
|
Product: MailNews → Core
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•