[go: nahoru, domu]

Open Bug 732894 Opened 13 years ago Updated 6 years ago

Get/Read subject via MAPI access

Categories

(MailNews Core :: Simple MAPI, defect)

x86_64
Windows 7
defect
Not set
major

Tracking

(Not tracked)

People

(Reporter: horak, Assigned: hiro)

References

Details

(Whiteboard: [patchlove])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build ID: 20120215223356

Steps to reproduce:

It looks like MAPIReadMail() has got some problems in reading the subject. If the subject of the mail is encoded (possibly due to Umlauts or such) by the sending application, 'lpszSubject' does contain the encoded subject line ("=?...?=…?="), not the decoded one.

In this state, fetching mails from Thunderbird with MAPI is not really usable.
Severity: normal → major
Component: General → Simple MAPI
Product: Thunderbird → MailNews Core
QA Contact: general → simple-mapi
Attached patch Proposed fixSplinter Review
I had tried to write an xpcshell test for this issue with jsctypes, but could not unfortunately.
Assignee: nobody → hiikezoe
Attachment #643236 - Flags: review?(mozilla)
Comment on attachment 643236 [details] [diff] [review]
Proposed fix

I'm hoping Neil can look at this...
Attachment #643236 - Flags: review?(mozilla) → review?(neil)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Sorry for taking so long to get back to you on this.

Looking at the MAPI code it looks as if it hasn't been changed in years; nearly everything is still in ANSI. I guess this is a case of "If it isn't broken, don't fix it." Would changing to Unicode cause problems? Obviously I'm not asking you to rewrite msgMapi in Unicode, but maybe you could just do the subject for now, and fix other stuff as needed later?
(In reply to neil@parkwaycc.co.uk from comment #3)
> Sorry for taking so long to get back to you on this.
> 
> Looking at the MAPI code it looks as if it hasn't been changed in years;
> nearly everything is still in ANSI. I guess this is a case of "If it isn't
> broken, don't fix it." Would changing to Unicode cause problems? Obviously
> I'm not asking you to rewrite msgMapi in Unicode, but maybe you could just
> do the subject for now, and fix other stuff as needed later?

The problem here is not Unicode. The problem is that the subject is mime-encoded. The reason why the patch uses nsAString is nsIMsgDBHdr has no interface to obtain mime-decoded subject in nsCString.
Sure, but the subject wouldn't have been encoded if it had been in ASCII, would it?
No. I suppose nsIMsgDBHdr.mime2DecodedSubject is always set even if the subject is in ASCII. Am I missing something?
I'm concerned that by using the decoded subject you might get characters that can't be represented in the (char *) message->lpszSubject string.
Removing myslef on all the bugs I'm cced on. Please NI me if you need something on MailNews Core bugs from me.
Whiteboard: [patchlove]
Comment on attachment 643236 [details] [diff] [review]
Proposed fix

comments were made about patch, so clearing review requests
Attachment #643236 - Flags: review?(neil)
See Also: → 1521380
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: