colinrmitchell.com

Blog

Getting Exchange Mail on FreeBSD

Posted Wednesday, September 14th 2011 in FreeBSD - Permalink

The Evolution mail client has a plugin available to communicate with a Microsoft Exchange server over MAPI. It is pretty easy to set up for FreeBSD. When I set this up (2011-09-14), I had to apply a bug fix to the plugin code to get it to work, which is documented below. I discovered this patch in the Ubuntu Launchpad site.

First, we need to install Evolution,

# cd /usr/ports/mail/evolution
/usr/ports/mail/evolution # make install clean

After this is installed, we want to download the source of the Exchange plugin,

# cd /usr/ports/mail/evolution-mapi
/usr/ports/mail/evolution-mapi # make

This will download and build the port. However, we need to tweak one file and rebuild. Find the file

/usr/ports/mail/evolution-mapi/work/evolution-mapi-0.32.1/src/libexchangemapi/exchange-mapi-connection.c

and edit it. Change it according to the following diff:


--- old/exchange-mapi-connection.c 2011-04-15 15:25:37.566310966 +0200
+++ new/exchange-mapi-connection.c 2011-04-15 15:32:46.726311163 +0200
@@ -40,6 +40,8 @@

 #include 

 #define DEFAULT_PROF_NAME "mapi-profiles.ldb"
+#define HAVE_LIBMAPI_CONTEXT_PARAM
+

 static void register_connection (ExchangeMapiConnection *conn);
 static void unregister_connection (ExchangeMapiConnection *conn);
@@ -2969,7 +2971,7 @@
        }

        /* Get the hierarchy table */
- ms = GetHierarchyTable (&obj_folder, &obj_table, 
-                   TableFlags_Depth | TableFlags_NoNotifications | TableFlags_UseUnicode, &row_count);
+ ms = GetHierarchyTable (&obj_folder, &obj_table, TableFlags_Depth | TableFlags_NoNotifications, &row_count); 
        if (ms != MAPI_E_SUCCESS) {
                make_mapi_error (perror, "GetHierarchyTable", ms);
                result = FALSE;

Recompile and install the port,

# cd /usr/ports/mail/evolution-mapi
/usr/ports/mail/evolution-mapi # make install clean

You should now be able to set up and get emails for your Exchange account. Evolution crashed a couple of times for me while synchronising the folders, but after a couple of restarts, it seems to be working properly, i.e., sending and receiving emails.

Thanks goes out to Fabien Poussin (mobyfab) for this patch!


List Posts Newest Posts Page 1Next Page