Status

enhancement
RESOLVED DUPLICATE of bug 1048658
6 months ago
4 months ago

People

(Reporter: jorgk, Assigned: jorgk)

Tracking

Trunk

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 4 obsolete attachments)

Assignee

Description

6 months ago
See bug 1505315 for details.

https://docs.microsoft.com/en-gb/windows/desktop/api/mapi/nc-mapi-mapisendmailw

typedef struct MapiMessageW {
  ULONG            ulReserved;
  PWSTR            lpszSubject;
  PWSTR            lpszNoteText;
  PWSTR            lpszMessageType;
  PWSTR            lpszDateReceived;
  PWSTR            lpszConversationID;
  FLAGS            flFlags;
  lpMapiRecipDescW lpOriginator;
  ULONG            nRecipCount;
  lpMapiRecipDescW lpRecips;
  ULONG            nFileCount;
  lpMapiFileDescW  lpFiles;
}  *lpMapiMessageW;

typedef struct MapiRecipDescW {
  ULONG ulReserved;
  ULONG ulRecipClass;
  PWSTR lpszName;
  PWSTR lpszAddress;
  ULONG ulEIDSize;
  PVOID lpEntryID;
}  *lpMapiRecipDescW;

typedef struct MapiFileDescW {
  ULONG ulReserved;
  ULONG flFlags;
  ULONG nPosition;
  PWSTR lpszPathName;
  PWSTR lpszFileName;
  PVOID lpFileType;
}  *lpMapiFileDescW;
Assignee

Comment 1

6 months ago
Posted patch 1506488-MAPISendMailW.patch (obsolete) — Splinter Review
How about this? Basically a copy/paste job. The original code was ugly, so it the result.

I added some debug and SendMailW() is now run when using "Sent to > Mail recipient". Sadly no compose window comes up, so something appears to be wrong. This needs more debugging.

I had the impression that something was wrong with subject and body, see bug 1505315 comment #21.

The subject should be:
Emailing: (list of file names)
and the body:
Your message is ready to be sent with the following file or link attachments:
(etc).

I only saw an E and a Y.
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Attachment #9024328 - Flags: feedback?(VYV03354)
Assignee

Comment 2

6 months ago
The compose window doesn't open since the file is not found, debug shows:
=== CMapiImp::SendMailW
nsMapiHook::HandleAttachments: filename:  path: D exists = false
=== HandleAttachments 80520006
=== PopulateCompFieldsW 80520006

Something wrong in the string manipulation. That's strange since my initial patch in bug 1505315, attachment 9024216 [details] [diff] [review], didn't show subject/body, but the compose window opened and the file was attached.
Attachment #9024328 - Attachment is obsolete: true
Attachment #9024328 - Flags: feedback?(VYV03354)
Assignee

Comment 3

6 months ago
I can't get this to work. The "unicode" strings for file path, subject and body aren't correct. No idea why.
Attachment #9024451 - Attachment is obsolete: true
Assignee

Comment 4

6 months ago
This uses all the wrong structures, subject and body don't work either, but at least the file is attached properly. It's the same filename processing, but here it works and in the other patch it doesn't. Quite puzzling :-(

Masatoshi-san, can you see what's going on?
Assignee

Comment 5

6 months ago
This patch uses the wrong structures. By the looks of it, the "regular" structures and the "wide" structures are the same apart from the character pointers.

Unlike the other patch which uses the "right" structures, with this patch at least the file gets attached to the message. Subject and body are truncated to one character. In the other patch which uses the "right" structures, nothing works.

So I'm confused.
Attachment #9024556 - Attachment is obsolete: true
Attachment #9024844 - Flags: feedback?(VYV03354)
Assignee

Comment 6

6 months ago
Oops, I forgot to transplant the unicode processing from the other patch. Here it is now, but subject and body are still only one char long, E(mail ...) and Y(our ...).
Attachment #9024844 - Attachment is obsolete: true
Attachment #9024844 - Flags: feedback?(VYV03354)
Attachment #9024853 - Flags: feedback?(VYV03354)
Assignee

Comment 7

4 months ago

Mike is working on this, too, and we didn't know :-(

Status: ASSIGNED → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1048658
Assignee

Updated

4 months ago
Attachment #9024853 - Flags: feedback?(VYV03354)
You need to log in before you can comment on or make changes to this bug.