GNOME Bugzilla – Bug 550474
MAPI calendar: authentication failure
Last modified: 2008-11-22 18:25:58 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 {
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! :-)
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 :-)