http://bugs.winehq.org/show_bug.cgi?id=11770
Summary: mapi32.dll.so does not support attachments for sending mail Product: Wine Version: 0.9.56. Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: -unknown AssignedTo: [email protected] ReportedBy: [email protected]
Applications like Microsoft Excel 2002 and Word 2002 have a File...Send To function which should bring up an email client with the current file attached. The DLL override mapi32.dll.so does not support attachments. The sendmail.c source for this dll has a FIXME which outputs "Ignoring attachments".
http://bugs.winehq.org/show_bug.cgi?id=11770
Lei Zhang [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #1 from Lei Zhang [email protected] 2008-02-28 15:35:11 --- There's been a few attempts, but none of them made it into Wine.
http://bugs.winehq.org/show_bug.cgi?id=11770
Hans Leidekker [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #2 from Hans Leidekker [email protected] 2008-02-29 05:00:28 --- Marks attempt at fixing this bug: http://www.winehq.org/pipermail/wine-patches/2007-December/048198.html
And the discussion that followed: http://www.winehq.org/pipermail/wine-devel/2007-December/061349.html
http://bugs.winehq.org/show_bug.cgi?id=11770
Mark Neyhart [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]. | |us
--- Comment #3 from Mark Neyhart [email protected] 2008-02-29 12:01:18 --- That was me with an earlier patch submission. I got busy after the initial discussion and am finally taking another look at this.
I looked at winebrowser per Hans' recommendation and I have come up against the issue of how any given email client will support attachments from the command line. I know how thunderbird and xdg-email work and have found references describing how kmail and evolution work as well. Just these four clients have four different methods. Rather than attempt to discern between the different methods within winebrowser I am tempted to modify winebrowser so that it uses an attachment only when calling xdg-email, and to let xdg-email sort out the differences.
Should a discussion like this be here or on the devoloper mailing list?
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #4 from Hans Leidekker [email protected] 2008-02-29 12:32:42 ---
Rather than attempt to discern between the different methods within winebrowser I am tempted to modify winebrowser so that it uses an attachment only when calling xdg-email, and to let xdg-email sort out the differences.
Yes, that's the way forward. Perhaps you can make the command line parameter compatible with xdg-email so that you can pass through the argument without additional processing.
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #5 from Tefnet developers [email protected] 2008-04-02 08:20:19 --- Created an attachment (id=11805) --> (http://bugs.winehq.org/attachment.cgi?id=11805) mapi32 MAPISendMail attachments support
Here is Marks patch for current version of Wine. I've modified it a little bit because for some reason message->lpFiles[i].lpszFileName was always NULL even if message->lpFiles[i].lpszPathName was set.
http://bugs.winehq.org/show_bug.cgi?id=11770
Austin English [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #6 from Austin English [email protected] 2009-03-30 12:45:08 --- Is this still an issue in current (1.1.18 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=11770
Tefnet developers [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #7 from Tefnet developers [email protected] 2009-04-06 04:18:03 --- (In reply to comment #6)
Is this still an issue in current (1.1.18 or newer) wine?
Yes it is... in dlls/mapi32/sendmail.c
--- if (message->nFileCount) FIXME("Ignoring attachments\n"); ---
but patch posted in this bug report still works...
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #8 from Austin English [email protected] 2009-04-06 11:05:00 --- Adding a testcase and submitting it to wine-patches would help...
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #9 from Tefnet developers [email protected] 2009-04-06 11:26:24 --- (In reply to comment #8)
Adding a testcase and submitting it to wine-patches would help...
1. I have no idea how to write tests for this case... It uses external native app (xdg-open/xdg-email) to prepare an email... Tell me if you know how to do it in non-interactive way then I will try to write it...
2. Patch is not mine... I've only updated it for current wine...
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #10 from Austin English [email protected] 2009-04-06 12:06:06 --- (In reply to comment #9)
(In reply to comment #8)
Adding a testcase and submitting it to wine-patches would help...
- I have no idea how to write tests for this case... It uses external native
app (xdg-open/xdg-email) to prepare an email... Tell me if you know how to do it in non-interactive way then I will try to write it...
Yeah, just looked at the patch, ignore that comment.
- Patch is not mine... I've only updated it for current wine...
Send it in, and say 'based on patch by Mark Neyhart'.
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #11 from Tefnet developers [email protected] 2009-04-07 03:04:25 --- (In reply to comment #10)
(In reply to comment #9)
(In reply to comment #8)
Adding a testcase and submitting it to wine-patches would help...
- I have no idea how to write tests for this case... It uses external native
app (xdg-open/xdg-email) to prepare an email... Tell me if you know how to do it in non-interactive way then I will try to write it...
Yeah, just looked at the patch, ignore that comment.
- Patch is not mine... I've only updated it for current wine...
Send it in, and say 'based on patch by Mark Neyhart'.
First we need to handle bug #12326 because even if this patch will generate proper mailto url for xdg-mail, it will be cut in the middle because it won't fit into wfileName[MAX_PATH] (more to read in bug report #12326)
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #12 from Austin English [email protected] 2009-10-12 14:37:54 --- Owen recently did a lot of work on this: http://source.winehq.org/git/wine.git/?a=history;f=dlls/mapi32;hb=HEAD
I think this may be fixed now.
http://bugs.winehq.org/show_bug.cgi?id=11770
Owen Rudge [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #13 from Owen Rudge [email protected] 2009-11-11 16:27:48 --- (In reply to comment #12)
Owen recently did a lot of work on this: http://source.winehq.org/git/wine.git/?a=history;f=dlls/mapi32;hb=HEAD
I think this may be fixed now.
It should be fixed for Windows-based mail clients, but native clients will still not support attachments.
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #14 from Austin English [email protected] 2009-11-11 21:03:25 --- (In reply to comment #13)
(In reply to comment #12)
Owen recently did a lot of work on this: http://source.winehq.org/git/wine.git/?a=history;f=dlls/mapi32;hb=HEAD
I think this may be fixed now.
It should be fixed for Windows-based mail clients, but native clients will still not support attachments.
Using xdg-mail?
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #15 from Owen Rudge [email protected] 2009-11-12 01:51:30 --- (In reply to comment #14)
Using xdg-mail?
As you can see at:
http://source.winehq.org/git/wine.git/?a=blob;f=dlls/mapi32/sendmail.c;h=cbb...
attachment support is simply not included in the fallback routine, which uses the system default mail client. Mainly because there is no universal protocol for attachments via mailto: - certain clients ignore attachments completely, or know of them but disallow them, or just don't know of them and ignore the entire request, as discussed in the other comments.
Ideally, what needs implementing is a Wine-specific MAPI provider which passes through MAPI calls to the native mail client (possibly via xdg-mail on Linux, for instance). At the moment, if any Windows MAPI provider (eg, Outlook, OE, Thunderbird) is installed, the fallback routine is ignored. Providing a Wine MAPI provider would mean it would be listed in the list of mail clients in Internet Options, and the user could therefore pick such a mail client as their preference.
This is something I might do at some point - it would be relatively straightforward. But the attachment issue is still a problem as long as e-mail clients have no agreed way of programmatically attaching files to mails.
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #16 from Austin English [email protected] 2009-11-12 11:45:31 --- (In reply to comment #15)
(In reply to comment #14)
Using xdg-mail?
As you can see at:
http://source.winehq.org/git/wine.git/?a=blob;f=dlls/mapi32/sendmail.c;h=cbb...
attachment support is simply not included in the fallback routine, which uses the system default mail client. Mainly because there is no universal protocol for attachments via mailto: - certain clients ignore attachments completely, or know of them but disallow them, or just don't know of them and ignore the entire request, as discussed in the other comments.
Ideally, what needs implementing is a Wine-specific MAPI provider which passes through MAPI calls to the native mail client (possibly via xdg-mail on Linux, for instance). At the moment, if any Windows MAPI provider (eg, Outlook, OE, Thunderbird) is installed, the fallback routine is ignored. Providing a Wine MAPI provider would mean it would be listed in the list of mail clients in Internet Options, and the user could therefore pick such a mail client as their preference.
Perhaps this bug should be closed and a new one opened...
This is something I might do at some point - it would be relatively straightforward. But the attachment issue is still a problem as long as e-mail clients have no agreed way of programmatically attaching files to mails.
Perhaps propose a standard to [email protected] / https://bugs.freedesktop.org/ ?
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #17 from Austin English [email protected] 2010-05-19 16:53:12 --- (In reply to comment #16)
(In reply to comment #15)
This is something I might do at some point - it would be relatively straightforward. But the attachment issue is still a problem as long as e-mail clients have no agreed way of programmatically attaching files to mails.
Perhaps propose a standard to [email protected] / https://bugs.freedesktop.org/ ?
Actually, seems attachments are standardized with xdg-email --attach file see: http://ohnopublishing.net/doc/xdg-utils-1.0.2-r3/html/html/xdg-email.html
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #18 from Austin English [email protected] 2011-08-08 20:14:13 CDT --- 2bdcee13a083f68ef8482aa85f7859ee887a738b and b4b7724a790af8fdab693ef5d422a1b84d7941a7 seem related.
http://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #19 from Owen Rudge [email protected] 2011-08-09 05:15:02 CDT --- (In reply to comment #18)
2bdcee13a083f68ef8482aa85f7859ee887a738b and b4b7724a790af8fdab693ef5d422a1b84d7941a7 seem related.
2bdcee13 adds support for sending attachments in a particular case - when a MAPI provider has been selected that only offers an Extended MAPI interface, not Simple MAPI. MS Outlook is one such application. It'll make no difference to the default Wine MAPI provider.
The code that was in b4b7724a is now in winemapi, but that just attempts to start whatever program handles the "mailto" protocol, which doesn't have (guaranteed) support for attachments. We can't assume that xdg-email will be available though (e.g., on OS X it definitely won't be). In theory we could try to see if xdg-email is present and use it if found, falling back to mailto: afterwards.
http://bugs.winehq.org/show_bug.cgi?id=11770
André H. [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #20 from André H. [email protected] 2012-12-17 17:09:01 CST --- bug still present in wine-1.5.19
http://bugs.winehq.org/show_bug.cgi?id=11770
Wylda [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
http://bugs.winehq.org/show_bug.cgi?id=11770
Vijay Kamuju [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #21 from Vijay Kamuju [email protected] --- Could you please test with 1.7.x latest version
https://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #22 from Austin English [email protected] --- (In reply to Vijay Kamuju from comment #21)
Could you please test with 1.7.x latest version
It's still present in 1.7.51.
https://bugs.winehq.org/show_bug.cgi?id=11770
Jeremy White [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #23 from Jeremy White [email protected] --- I've spent some time exploring this.
I considered three approaches. The first involved modifying winebrowser to add an &attach= stanza to the mailto URI. That works with xdg-email and Thunderbird on XFCE on Linux. It's not clear if it would work anywhere else, and the &attach= expression is not a documented part of the mailto uri specification.
The second approach was to create an xdgmime dll, parallel to the winemapi dll. The downside to that is that the mapi32 specification does not seem to allow for any sort of cascade or fallback, or any way to intelligently set a default provider. So while that felt more correct in some ways, it seemed likely to result in bit rot, and thus be less desirable.
Finally, I decided to modify winemapi dll itself to look for xdg-email, and if found, use it directly, rather than going through winebrowser. A patch with this change was submitted here: https://www.winehq.org/pipermail/wine-devel/2016-November/115298.html
https://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #24 from Mark Neyhart [email protected] --- Created attachment 60687 --> https://bugs.winehq.org/attachment.cgi?id=60687 Patch winemapi.dll to support SendTo from Excel and Word
https://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #25 from Mark Neyhart [email protected] --- Comment on attachment 60687 --> https://bugs.winehq.org/attachment.cgi?id=60687 Patch winemapi.dll to support SendTo from Excel and Word
Here is the latest version of the patch that I have been using for the last 10 years. It uses WineBrowser to call xdg-email. Required registry entries are
[HKEY_CURRENT_USER\Software\Wine\WineBrowser] "Mailers"="xdg-email"
[HKEY_LOCAL_MACHINE\Software\Clients\Mail] @="Native Mail Client"
I have been using this successfully to support the Send To function for Word 2003, Word 2007, Excel 2003, and Excel 2007 in various versions of Crossover Office. It uses temporary files to hold the attachments which do not get cleaned up because I don't know when the email client is done with them. The code is written to support multiple attachments, but I don't know how well it works because Word and Excel only attach one file via the Send To function.
WineBrowser seems to handle the &attach= parameter without issue.
https://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #26 from Austin English [email protected] --- (In reply to Mark Neyhart from comment #25)
Comment on attachment 60687 [details] Patch winemapi.dll to support SendTo from Excel and Word
Here is the latest version of the patch that I have been using for the last 10 years. It uses WineBrowser to call xdg-email. Required registry entries are
[HKEY_CURRENT_USER\Software\Wine\WineBrowser] "Mailers"="xdg-email"
[HKEY_LOCAL_MACHINE\Software\Clients\Mail] @="Native Mail Client"
I have been using this successfully to support the Send To function for Word 2003, Word 2007, Excel 2003, and Excel 2007 in various versions of Crossover Office. It uses temporary files to hold the attachments which do not get cleaned up because I don't know when the email client is done with them. The code is written to support multiple attachments, but I don't know how well it works because Word and Excel only attach one file via the Send To function.
WineBrowser seems to handle the &attach= parameter without issue.
I can confirm this works with Advanced SystemCare (bug 40534), which tries to attach its bug report to an email to send to its support team. Without the patch it opens thunderbird with a subject/to, but no attachments. With it, my bug report and screenshot are attached.
@Mark, if you're not aware, patches are not picked up from bugzilla. Please see https://wiki.winehq.org/Submitting_Patches for how to send your patch into Wine.
https://bugs.winehq.org/show_bug.cgi?id=11770
Alistair Leslie-Hughes [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
--- Comment #27 from Alistair Leslie-Hughes [email protected] ---
I can confirm this works with Advanced SystemCare (bug 40534), which tries to attach its bug report to an email to send to its support team. Without the patch it opens thunderbird with a subject/to, but no attachments. With it, my bug report and screenshot are attached.
@Austin, does Jeremy's patch from #c23 fix the problem?
https://bugs.winehq.org/show_bug.cgi?id=11770
Austin English [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
https://bugs.winehq.org/show_bug.cgi?id=11770
--- Comment #28 from Austin English [email protected] --- (In reply to Alistair Leslie-Hughes from comment #27)
I can confirm this works with Advanced SystemCare (bug 40534), which tries to attach its bug report to an email to send to its support team. Without the patch it opens thunderbird with a subject/to, but no attachments. With it, my bug report and screenshot are attached.
@Austin, does Jeremy's patch from #c23 fix the problem?
Yep, both Jeremy and Mark's patches fix attaching files to a Thunderbird draft.
https://bugs.winehq.org/show_bug.cgi?id=11770
Alistair Leslie-Hughes [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Staged patchset| |https://github.com/wine-sta | |ging/wine-staging/tree/mast | |er/patches/winemapi-user-xd | |g-mail Status|NEW |STAGED
https://bugs.winehq.org/show_bug.cgi?id=11770
tokktokk [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected]
https://bugs.winehq.org/show_bug.cgi?id=11770
Zeb Figura [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |99c1a343c1865cece709d73e978 | |fbac7ea04f753 Resolution|--- |FIXED Status|STAGED |RESOLVED CC| |[email protected]
--- Comment #29 from Zeb Figura [email protected] --- Fixed by 99c1a343c1865cece709d73e978fbac7ea04f753.
https://bugs.winehq.org/show_bug.cgi?id=11770
Alexandre Julliard [email protected] changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #30 from Alexandre Julliard [email protected] --- Closing bugs fixed in 9.17.