After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 550474 - MAPI calendar: authentication failure
MAPI calendar: authentication failure
Status: RESOLVED FIXED
Product: evolution-mapi
Classification: Applications
Component: Calendar
0.1
Other Linux
: Normal normal
: ---
Assigned To: evolution-calendar-maintainers
Evolution QA team
evolution[mapi]
Depends on:
Blocks:
 
 
Reported: 2008-09-02 14:49 UTC by Patrick Ohly
Modified: 2008-11-22 18:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Patrick Ohly 2008-09-02 14:49:32 UTC
I got the MAPI branch compiled from source (revision up-to-date as of today). I could access the server and see mail (but not read them because character encoding was screwed up - a different problem).

Accessing calendars didn't work. It asked for a password each time I tried to activate a calendar and reported an authentication error in the console log.

I traced it down to e_cal_backend_mapi_authenticate() in e-cal-backend-mapi.c which called exchange_mapi_connection_new() a) without the necessary password and b) with the wrong profile string.

Adding a call as it is done camel-mapi-store.c solved the problem. For the sake of illustration I left the old call in (also as fallback), but I seriously wonder how that code could have possibly worked.

Here's my change:

Index: calendar/backends/mapi/e-cal-backend-mapi.c
===================================================================
--- calendar/backends/mapi/e-cal-backend-mapi.c (revision 9450)
+++ calendar/backends/mapi/e-cal-backend-mapi.c (working copy)
@@ -104,7 +104,11 @@
        cbmapi = E_CAL_BACKEND_MAPI (backend);
        priv = cbmapi->priv;
 
-       if (authenticated || exchange_mapi_connection_exists () || exchange_mapi_connection_new (priv->user_email, NULL)) {
+       if (authenticated || exchange_mapi_connection_exists () ||
+           /* this is how the function is called in camel-mapi-store.c, which works by using the default profile */
+           exchange_mapi_connection_new (NULL, priv->password) ||
+           /* this call doesn't pass the password and uses the wrong profile (first.last@mail.domain instead of account@windowsdomain) */
+           exchange_mapi_connection_new (priv->user_email, NULL)) {
                authenticated = TRUE;
                return GNOME_Evolution_Calendar_Success;
        } else {
Comment 1 Suman Manjunath 2008-09-22 05:34:50 UTC
Nicolas Tetreault reported the same issue on openchange-devel

Honestly, I don't understand why we are not storing user_email as the profile name, in which case the existing code would automatically work. 

Anyway, this approach would work as long as we stick to "one MAPI account only per e-d-s instance". This may not be the case when Julien's mapi-session work gets into LibMAPI. We may have more to do later. 

For now, I would test this patch and commit it. Thanks Patrick! :-)
Comment 2 Suman Manjunath 2008-09-22 06:43:49 UTC
Fixed in SVN r9575
http://svn.gnome.org/viewvc/evolution-data-server?view=revision&revision=9575

I managed to avoid using the default profile everytime :-)