Bug 41725

Summary: CONFIGURATION: HKCU defined mail client should be used instead of HKLM defined by "Document as E-mail" toolbar button
Product: LibreOffice Reporter: Lenge <Spampot>
Component: UIAssignee: Not Assigned <libreoffice-bugs>
Status: NEEDINFO --- QA Contact:
Severity: normal    
Priority: medium CC: commerce, jmadero.dev, LibreOffice, richard416282, Spampot, todventtu
Version: 3.4.3 release   
Hardware: Other   
OS: Windows (All)   
Whiteboard: BSA
i915 platform: i915 features:

Description Lenge 2011-10-12 10:19:09 UTC
A small Windows-specific bug that has survived at least since OOo 3.2: The "Document as E-mail" toolbar button (usually the 4th button in the main toolbar) opens the wrong mail client if the current user has specified a default client that differs from the respective admin setting.

The toolbar button seems to always use the mail client that is stored in the registry at "HKLM\Software\Clients\Mail", which is an admin-only setting that normal users cannot change.

If the current user has set his own default client (stored at "HKCU\Software\Clients\Mail"), this setting is supposed to have precedence over the admin setting. However, it is ignored by the above toolbar button (same in Writer and Calc, not sure about the other apps).

Unlike this specific toolbar button, the rest of LibreOffice (and all other apps that I came across) behaves as expected: If you click a "mailto" URL in a document, the correct (user-specific) mail client opens.

Not a big deal, but should be fixed someday.

Steps to reproduce:
1. On a Windows XP machine, leave the "HKLM\Software\Clients\Mail" admin setting at its default value "Outlook Express".
2. Login as a user and set a different user-specific default mail client (e. g. by clicking the accoring GUI option in Thunderbird, or by directly writing "Mozilla Thunderbird" to "HKCU\Software\Clients\Mail"). 
3. While logged in as the above user, run Writer (or Calc) and click the "Document as E-mail" toolbar button.

Current behavior:
Outlook Express is opened (which is wrong).

Expected behavior:
Mozilla Thunderbird should open instead.

Platform (if different than the browser): 
Windows XP
              
Browser: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Comment 1 Rainer Bielefeld Retired 2011-10-12 23:11:31 UTC
I will check that soon
- Reported with Bug Submission Assistant -
Comment 2 Urmas 2012-02-26 01:40:24 UTC
Writer uses MAPI interface handler, a system-wide setting.
Comment 3 Lenge 2012-02-26 13:08:54 UTC
Cite: "Writer uses MAPI interface handler, a system-wide setting."

That is more of a different bug description instead of a resolution. Is it really an explicit design goal to make Writer ignore the user-specific mail client and thereby enforce one that the currently logged-in user has not even configured to work for him? And, if so, then why is this behavior only present for this one toolbar button?

I sincerely think that this button should behave just as if any "mailto:" link was clicked in any LibreOffice application (even in Writer!) - which opens the correct (user-specific) mail client.

Or is there any specific reason for insisting on the current behavior that I might have missed?
Comment 4 Rainer Bielefeld Retired 2012-02-26 21:15:36 UTC
@David:
May be Help should be more meaningful telling what "the default ail client" is.
Comment 5 Michael Meeks 2012-02-27 01:55:52 UTC
> That is more of a different bug description instead of a resolution. Is it
> really an explicit design goal to make Writer ignore the user-specific mail
> client and thereby enforce one that the currently logged-in user has not even
> configured to work for him? And, if so, then why is this behavior only present
> for this one toolbar button?

If you can find an API that can be used to -send- mail - ie. not just launch a mail client, but populate it with contents, and preferably silently send the mail out for mail-merge, and then work on replacing the MAPI code [ which provides just such an API ], with this new API then you're welcome to ! :-)

In the meantime to resolve the inconsistency, we could remove / hide the - 'mailto:' handler selection on Windows I suppose - if that makes you happy, and try to track / deduce that setting from whatever Windows is using for the MAPI library: would that solve the problem for you ?
Comment 6 Lenge 2012-02-27 06:16:20 UTC
[b]@Michael:[/b] If you are looking for an API to *silently* send emails without any mail client showing up, you can use the according functionality of Microsoft's Collaborative Data Objects (CDO). I have example code (Excel VBA) on how to use it if you are interested. There also are other ways such as the free BLAT SMTP engine (www.blat.net). However, for silently sending emails without user interaction, you'd need the user to pre-define an according SMTP account or provide your own.

But, concerning the "Document as E-mail" toolbar button, I think the intended behavior is not to have it sending an email silently (to whom?), but to open the user's mail client for a new email with the current LibreOffice document already attached. At least this is what it currently does, and it works independent of a specific email client (I checked with Outlook, Outlook Express, and Thunderbird). The problem is just that it insists on using the HKLM (admin-only) instead of the HKCU (user) defined mail client.

I admit I am not aware of how to make the MAPI interface use the HKCU client, or of an alternative API to do it (which does not mean that there is none; I'll keep my eyes open). Yet still, I think my request is reasonable and should be resolved, so we should keep it open.

[cite]In the meantime to resolve the inconsistency, we could remove / hide the -
'mailto:' handler selection on Windows I suppose [...][/cite]

The current "mailto:" handler implementation behaves exactly as expected and consistent with Windows itself and almost all other applications out there, so there is no need to change it in any way.
Comment 7 Rainer Bielefeld Retired 2012-02-27 09:19:02 UTC
I failed to reproduce the problem with WIN XP on VirtualBox, but may because I did not succeed in creating different mail settings in WIN System-Settings-Internet - Mail program for User and admin.

@Lenge
It will not attract much interest if there is a problem after some Registry handicraft. 

It would be useful if you can contribute a step by step instruction for the standard "Admin and User are the same" WIN XP user using Seamonkey (or thunderbird) how to create a second WIN user account with a different Mail client (OE) and how to reproduce the problem with a little WRITER document only containing mail link.
Comment 8 Lenge 2012-02-27 10:42:15 UTC
@Rainer: Here are step-by-step instructions to reproduce the bug:

1. A freshly installed Windows XP comes with a built-in "Administrator" account, and the system-wide (HKLM) mail client is "Outlook Express" by default.
2. Log in as "Administrator" and create a non-admin "User" account (a member of group "Users", but not "Administrators").
3. Still as admin, install LibreOffice and Thunderbird, but do not change the admin's default mail client. No need to run Thunderbird as admin.
4. Now log in as "User", run and config Thunderbird. At "Tools/Options.../Advanced/General", use the "System Integration" options to make Thunderbird the default mail client. (This will change the HKCU option to Thunderbird, while the system-wide HKLM setting still remains Outlook Express.)
5. Still as "User", run Writer and press the "Document as E-mail" toolbar button. This will (incorrectly) try to open Outlook Express (HKLM setting) instead of Thunderbird (HKCU setting).
6. In Writer, type "mailto:whoever@whatever.whereever" and let it automatically convert into a hyperlink after typing an additional whitespace. Now Ctrl-Click the hyperlink and see Thunderbird open (as should be).

Can you reproduce the issue this way?

The point is that non-admin users cannot change the system-wide (HKLM) setting (which is typically accessed via "Control Panel/Internet Options/Programs/E-mail"), but may still select their own user-specific default mail client (via the HKCU setting, with is accessed e. g. by Thunderbird's above config option). So, if both settings exist (and possibly differ), the HKCU one is to be used.
Comment 9 Lenge 2012-02-27 11:22:34 UTC
@Rainer: I just found a simpler way to reproduce the issue that only deals with a single admin account (e. g. the built-in "Administrator") while no additional user account is required:

- As already said, the system wide "HKLM\Software\Clients\Mail" setting is typically accessed via the "Control Panel/Internet
Options/Programs/E-mail" GUI option, and the corresponding user-specific HKCU setting is accessed via the according GUI option of the mail client (such as Thunderbird). So both options can be set without directly manipulating the registry.

- After a fresh Windows XP install, the system-wide "HKLM\Software\Clients\Mail" setting is "Outlook Express", and the user-specific "HKCU\Software\Clients" does not yet exist.

- When installing Thunderbird and setting it to the default mail client, "HKCU\Software\Clients\Mail" is created and points to "Mozilla Thunderbird". The system-wide HKLM setting is left unchanged and still points to "Outlook Express".

- This is enough to reproduce the buggy behavior of Writer's "Document as E-mail" toolbar button. Can you?
Comment 10 Joel Madero 2014-11-05 03:59:30 UTC
Never independently confirmed by QA team - moving to UNCONFIRMED to make sure they see it. Thanks for your patience and understanding.
Comment 11 Beluga 2014-11-16 10:40:45 UTC
Apologies for the "NEEDINFO without testing" dirty trick, but I was tempted to ask, if this is still relevant with XP being EOL ie. does this happen with Win 7 or 8?

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.