[#13346] Activesync identities should use the default identity as a default in the Webmail edition
Summary Activesync identities should use the default identity as a default in the Webmail edition
Queue Horde Framework Packages
Queue Version Git master
Type Enhancement
State Resolved
Priority 1. Low
Owners mrubinsk@horde.org
Requester software-horde@interfasys.ch
Created 2014-07-10 (2185 days ago)
Due
Updated 2014-07-12 (2183 days ago)
Assigned
Resolved 2014-07-12 (2183 days ago)
Milestone
Patch No

Comments
software-horde@interfasys.ch 2014-07-10 14:58:44
In a webmail context, unless I don't understand what the "Horde 
default" is, it doesn't make sense to use one system-wide identity for 
all the email accounts which will be managed by the system. On top of 
that, users will have no idea what it means.

So I think the default for the Activesync identity in both the 
Activesync and Kronolith prefs should be set to Default Identity as a 
default.

Also, it's not possible to send emails from a mobile device unless the 
default identity has the email address field populated. This was not 
necessary in the past, so maybe, if empty, that field could be 
populated at login time with the email address provided?

Michael Rubinsky <mrubinsk@horde.org> 2014-07-10 15:48:31
> In a webmail context, unless I don't understand what the "Horde 
> default" is, it doesn't make sense to use one system-wide identity 
> for all the email accounts which will be managed by the system. On 
> top of that, users will have no idea what it means.
>
> So I think the default for the Activesync identity in both the 
> Activesync and Kronolith prefs should be set to Default Identity as 
> a default.

It already IS, unless I am misunderstanding what you are saying.

> Also, it's not possible to send emails from a mobile device unless 
> the default identity has the email address field populated. This was 
> not necessary in the past, so maybe, if empty, that field could be 
> populated at login time with the email address provided?

This was already discussed on the mailing list. A properly configured 
identity is a REQUIREMENT for using email in Horde, period. IMP 
doesn't work without one either. If you don't want the user to be 
responsible for setting this up on their own then use a hook to 
populate it. IIRC, the pref_init hook can be used for something like 
this.



software-horde@interfasys.ch 2014-07-10 16:18:06
>> In a webmail context, unless I don't understand what the "Horde
>> default" is, it doesn't make sense to use one system-wide identity
>> for all the email accounts which will be managed by the system. On
>> top of that, users will have no idea what it means.
>>
>> So I think the default for the Activesync identity in both the
>> Activesync and Kronolith prefs should be set to Default Identity as a
>> default.
>
> It already IS, unless I am misunderstanding what you are saying.
>
I just did a test with the Horde defaults and a properly configured 
identity and it worked. I think I just did not understand the labels 
and it could be a problem for users as well.

Configured Horde Defaults: I thought it was a system wide account, but 
it seems to be the identity set as the default on the Personal 
Information pref page.

Why not just automagically select the default from the list and 
perhaps add a (default) next to it?
Something like this:
*Default Identity (default)*
Anonymous
Mobile

The user could select the mobile identity for activesync and If they 
change their default on the PI page, then the dropdown would be updated
Anonymous (default)
Default Identity
*Mobile*

Michael Rubinsky <mrubinsk@horde.org> 2014-07-10 16:27:23
>>> In a webmail context, unless I don't understand what the "Horde
>>> default" is, it doesn't make sense to use one system-wide identity
>>> for all the email accounts which will be managed by the system. On
>>> top of that, users will have no idea what it means.
>>>
>>> So I think the default for the Activesync identity in both the
>>> Activesync and Kronolith prefs should be set to Default Identity as a
>>> default.
>>
>> It already IS, unless I am misunderstanding what you are saying.
>>
> I just did a test with the Horde defaults and a properly configured 
> identity and it worked. I think I just did not understand the labels 
> and it could be a problem for users as well.
>
> Configured Horde Defaults: I thought it was a system wide account, 
> but it seems to be the identity set as the default on the Personal 
> Information pref page.

Any suggestions on better wording would be considered.

> Why not just automagically select the default from the list and 
> perhaps add a (default) next to it?
> Something like this:
> *Default Identity (default)*
> Anonymous
> Mobile

Because selecting the "Horde Default" means that whenever you change 
the default identity in the Personal Information preferences, this 
newly selected default identity would then be honored in those other 
applications as well. If we just set that value to whatever the 
currently selected default is, then the user would have to revisit all 
the other applications and change the value in those as well.


> The user could select the mobile identity for activesync and If they 
> change their default on the PI page, then the dropdown would be 
> updated
> Anonymous (default)
> Default Identity
> *Mobile*

Yes, the drop down could be modified, but the actual preference value 
in use would still be the previously selected one until the user 
changed it.


software-horde@interfasys.ch 2014-07-10 20:26:22
> Any suggestions on better wording would be considered.
Why not call it "Always use your default identity" then?

>
>> Why not just automagically select the default from the list and
>> perhaps add a (default) next to it?
>> Something like this:
>> *Default Identity (default)*
>> Anonymous
>> Mobile
>
> Because selecting the "Horde Default" means that whenever you change 
> the default identity in the Personal Information preferences, this 
> newly selected default identity would then be honored in those other 
> applications as well. If we just set that value to whatever the 
> currently selected default is, then the user would have to revisit 
> all the other applications and change the value in those as well.
>
Ah, of course.

> This was already discussed on the mailing list. A properly 
> configured identity is a REQUIREMENT for using email in Horde, 
> period. IMP doesn't work without one either. If you don't want the 
> user to be responsible for setting this up on their own then use a 
> hook to populate it. IIRC, the pref_init hook can be used for 
> something like this.
>
In 5.1, it was possible to send emails both from IMP and mobile 
without having to fill in any of the fields of the default identity.

I've looked at hooks prefs_init does not have access to application 
data and is cached for the session only, but I'll try with 
appauthenticated.

Michael Rubinsky <mrubinsk@horde.org> 2014-07-10 21:33:55

> In 5.1, it was possible to send emails both from IMP and mobile 
> without having to fill in any of the fields of the default identity.

No, it wasn't. IMP has ALWAYS required a valid "From" address to send 
email. Previously, ActiveSync used to rely on the client sending the 
From: header when sending an email, but that was changed since not all 
clients do this reliably.



software-horde@interfasys.ch 2014-07-10 21:35:25
I've found a way to make the prefs stick. The attached file is a hook 
which will fill the Identity's from field using the email address used 
at login time.

software-horde@interfasys.ch 2014-07-11 17:21:27
Is there a way to redirect the user to the identity page and to add a 
notification from the hook?


Michael Rubinsky <mrubinsk@horde.org> 2014-07-11 17:40:50
> Is there a way to redirect the user to the identity page and to add 
> a notification from the hook?

Redirect the user to the identity page from where?

software-horde@interfasys.ch 2014-07-11 17:50:29
>> Is there a way to redirect the user to the identity page and to add a
>> notification from the hook?
>
> Redirect the user to the identity page from where?

Right after logging in, ideally setting the 1st page the user sees 
from the prefs_init hook, because I don't know how to be able to tell 
later in the process if the from field has just been automatically 
populated or if it was there already.

Michael Rubinsky <mrubinsk@horde.org> 2014-07-11 17:56:21
>>> Is there a way to redirect the user to the identity page and to add a
>>> notification from the hook?
>>
>> Redirect the user to the identity page from where?
>
> Right after logging in, ideally setting the 1st page the user sees 
> from the prefs_init hook,

I guess you could try redirecting to the pref page if the identity 
pref is empty (ignoring the check if the current page IS the prefs 
page). Of course, that is left as an exercise for the reader.

> because I don't know how to be able to tell later in the process if 
> the from field has just been automatically populated or if it was 
> there already.

What does it matter?

Git Commit <commits@lists.horde.org> 2014-07-12 04:21:45
Changes have been made in Git (master):

commit 809d65eeb75ea6c424a2ac73390de5bb74510cd7
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Sat Jul 12 00:20:35 2014 -0400

     Fix regression when sending ActiveSync email and no From address 
is supplied in identity prefs.

     Bug: 13346

  framework/Core/lib/Horde/Core/ActiveSync/Mail.php |   13 +++++++++++--
  1 files changed, 11 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/809d65eeb75ea6c424a2ac73390de5bb74510cd7

Michael Rubinsky <mrubinsk@horde.org> 2014-07-12 04:25:12
I've rethought this.

The problem was that in IMP if a From address is not found in the 
identity AND a 'maildomain' is configured in IMP's backends.php file, 
then a From address can be built from that. ActiveSync doesn't use IMP 
to send email, and doesn't have access to IMP's IMAP configuration.

So, for ActiveSync, if we don't find a properly configured identity, 
fall back to the device's supplied From address and cross our fingers 
that it is accurate.

software-horde@interfasys.ch 2014-07-12 14:29:25
> I've rethought this.
>
> The problem was that in IMP if a From address is not found in the 
> identity AND a 'maildomain' is configured in IMP's backends.php 
> file, then a From address can be built from that. ActiveSync doesn't 
> use IMP to send email, and doesn't have access to IMP's IMAP 
> configuration.
>
> So, for ActiveSync, if we don't find a properly configured identity, 
> fall back to the device's supplied From address and cross our 
> fingers that it is accurate.
Great news. That way we can still tll people to fill in their profile, 
but thing will still work if they don't.