You are not logged in.

#1 2009-09-25 03:11:48

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Evolution-mapi 2.30 (Please read before using)

EDIT: There's now AUR packages for all these packages, so please do not use them directly.

Evolution-mapi is a plugin for Evolution which allows connectivity with an Exchange 2007 server for mail, contacts, and calendaring data. It has been standard in Evolution since 2.26, but due to its dependency on samba4 (which is alpha), we haven't gotten it in our repos as yet, and won't anytime soon it seems.

I've got my own PKGBUILDs which compile evolution-mapi for evolution 2.30. Three packages are needed, samba4 (alpha10), openchange (0.9), and evolution-mapi itself.

IMPORTANT: These PKGBUILDs work for me, but cannot be uploaded to the AUR because they install to /usr/local, which is only for user-compiled packages, violating the FHS. I just wanted to provide those who need Exchange 2007 connectivity a way to get it while waiting for samba4 to eventually emerge from alpha (don't hold your breath).

So, on to the PKGBUILDs. Firstly, samba4:-

# Maintainer: ngoonee <n g    o o n    e e <at gmail.com, delete all spaces>>
pkgname=samba4
pkgver=4.0.0A10
# We use the 'A' to fake out pacman's version comparators.  Samba chooses
# to append 'a','b',etc to their subsequent releases, which pamcan
# misconstrues as alpha, beta, etc.  Bad samba!
_realver=4.0.0alpha10
pkgrel=1
pkgdesc="Alpha build of samba4. This package was SPECIFICALLY created to support evolution-mapi and may not work for any other purpose."
arch=('i686' 'x86_64')
url="http://www.samba.org"
license=('GPL3')
depends=('db>=4.7' 'popt' 'libcups' 'acl' 'libldap' 'libcap>=2.16' 'heimdal>=1.2-1' 'pam' 'fam' 'gnutls>=2.4.1')
options=(!makeflags)
source=(http://us1.samba.org/samba/ftp/samba4/samba-${_realver}.tar.gz)    
md5sums=('e6b9e0fa90ddffd381790948c77d2152')

build() {
#  cd ${srcdir}/samba-${_realver}/lib/talloc
#  ./autogen.sh
#  ./configure --prefix=/usr/local/samba
#  make || return 1
#  make DESTDIR="$pkgdir/" install
#  make realdistclean
  cd ${srcdir}/samba-${_realver}/lib/tdb
  ./autogen.sh
  ./configure --prefix=/usr/local/samba
  make || return 1
  make DESTDIR="$pkgdir/" install
  make realdistclean
  cd ${srcdir}/samba-${_realver}/lib/tevent
  ./autogen.sh
  ./configure --prefix=/usr/local/samba
  make || return 1
  make DESTDIR="$pkgdir/" install
  make realdistclean
  cd ${srcdir}/samba-${_realver}/source4
  ./autogen.sh
  ./configure --prefix=/usr/local --enable-fhs
  make idl_full || return 1
  make || return 1
  make DESTDIR="$pkgdir/" install
}

Next, libmapi, via the openchange package. It depends on THIS SPECIFIC version of samba4, since the API is not yet stable AFAIK.

# Maintainer: ngoonee <n g    o o n    e e <at gmail.com, delete all spaces>>
pkgname=openchange
pkgver=0.9
pkgrel=1
pkgdesc="Library for MAPI connectivity with Microsoft Exchange. This package was SPECIFICALLY created to support evolution-mapi and may not work for any other purpose."
arch=('i686' 'x86_64')
url="http://www.openchange.org"
license=('GPL3')
#depends=('samba4=4.0.0A10')
options=(!makeflags)
source=(http://downloads.sourceforge.net/openchange/openchange-0.9\ CHOCHRANE/${pkgname}-${pkgver}-COCHRANE.tar.gz)
md5sums=('9dc6c91ea5d4afce4a5aa81215835b8b')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}-COCHRANE
  ./autogen.sh
  export PKG_CONFIG_PATH=/usr/local/samba/lib/pkgconfig:$PKG_CONFIG_PATH
  ./configure --prefix=/usr/local
  make || return 1
  make DESTDIR="$pkgdir/" install
}

Finally, evolution-mapi itself. Again, depends on this specific version of libmapi.

# Maintainer: ngoonee <n g    o o n    e e <at gmail.com, delete all spaces>>
pkgname=evolution-mapi
pkgver=0.30.0
_gnomever=0.30
pkgrel=1
pkgdesc="MAPI plugin for evolution."
arch=('i686' 'x86_64')
url="http://www.go-evolution.org"
license=('GPL3')
depends=('openchange=0.9')
options=(!makeflags)
source=(http://ftp.gnome.org/pub/gnome/sources/evolution-mapi/$_gnomever/${pkgname}-${pkgver}.tar.gz)
md5sums=('44635c18c03240ccc4cdf519c33a5c3d')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  export PKG_CONFIG_PATH=/usr/local/samba/lib/pkgconfig:$PKG_CONFIG_PATH
  export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH

  ./configure --prefix=/usr/local
  make || return 1
  make DESTDIR="$pkgdir/" install

  # Create necessary symlinks, for files from libmapi and samba4 installs
  for i in libmapi libdcerpc libldb libndr libsamba-hostconfig; do
    ln -s ./${i}.so ${pkgdir}/usr/local/lib/${i}.so.0
  done
}

I formerly posted up evolution-mapi-2.26 in another thread, but I thought community contributions would be a better place for this. Enjoy.

Last edited by ngoonee (2011-01-07 16:01:48)


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#2 2009-09-25 04:57:02

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: Evolution-mapi 2.30 (Please read before using)

I don't quite understand. Can't you change the install path to comply with the FHS? Or is this just a personal preference?

Last edited by sand_man (2009-09-25 04:58:03)


neutral

Offline

#3 2009-09-25 05:54:33

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Evolution-mapi 2.30 (Please read before using)

sand_man wrote:

I don't quite understand. Can't you change the install path to comply with the FHS? Or is this just a personal preference?

Sorry, should have been more clear. samba4 installs into /usr/samba (according to FHS), which conflicts with samba 3 (what we're having now). According to the devs, samba4 is not feature-complete relative to samba 3, therefore its an either/or. Samba 3.4 supposedly has the best of both worlds, though. I have not tried to install evolution-mapi on that, as yet, since it has not hit our repos (nor does it look like its going to), and the install looks... difficult, to say the least.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2009-10-20 07:45:37

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Evolution-mapi 2.30 (Please read before using)

UPDATE: Evo 2.28.1 is out, so a new version of evolution-mapi is out as well. No need for the previous patch file.

Leaving my previous post here for reference.

Evolution-mapi is a plugin for Evolution which allows connectivity with an Exchange 2007 server for mail, contacts, and calendaring data. It has been standard in Evolution since 2.26, but due to its dependency on samba4 (which is alpha), we haven't gotten it in our repos as yet, and won't anytime soon it seems.

I've got my own PKGBUILDs which compile evolution-mapi for evolution 2.28 (currently in [gnome-unstable], but soon to be promoted I believe). Three packages are needed, samba4 (alpha7), libmapi (0.8.2), and evolution-mapi itself.

IMPORTANT: These PKGBUILDs work for me, but cannot be uploaded to the AUR because they install to /usr/local, which is only for user-compiled packages, violating the FHS. I just wanted to provide those who need Exchange 2007 connectivity a way to get it while waiting for samba4 to eventually emerge from alpha (don't hold your breath).

So, on to the PKGBUILDs. Firstly, samba4:-

# Maintainer: ngoonee <n g    o o n    e e <at gmail.com, delete all spaces>>
pkgname=samba4
pkgver=4.0.0A7
# We use the 'A' to fake out pacman's version comparators.  Samba chooses
# to append 'a','b',etc to their subsequent releases, which pamcan
# misconstrues as alpha, beta, etc.  Bad samba!
_realver=4.0.0alpha7
pkgrel=1
pkgdesc="Alpha build of samba4. This package was SPECIFICALLY created to support evolution-mapi and may not work for any other purpose."
arch=('i686' 'x86_64')
url="http://www.samba.org"
license=('GPL3')
depends=('db>=4.7' 'popt' 'libcups' 'acl' 'libldap' 'libcap>=2.16' 'heimdal>=1.2-1' 'pam' 'fam' 'gnutls>=2.4.1' 'tdb>=3.3.6')
options=(!makeflags)
source=(http://us1.samba.org/samba/ftp/samba4/samba-${_realver}.tar.gz)

build() {
  cd ${srcdir}/samba-${_realver}/lib/talloc
  ./autogen.sh
  ./configure --prefix=/usr/local/samba
  make || return 1
  make DESTDIR="$pkgdir/" install
  make realdistclean
  cd ${srcdir}/samba-${_realver}/lib/tdb
  ./autogen.sh
  ./configure --prefix=/usr/local/samba
  make || return 1
  make DESTDIR="$pkgdir/" install
  make realdistclean
  cd ${srcdir}/samba-${_realver}/lib/tevent
  ./autogen.sh
  ./configure --prefix=/usr/local/samba
  make || return 1
  make DESTDIR="$pkgdir/" install
  make realdistclean
  cd ${srcdir}/samba-${_realver}/source4
  ./autogen.sh
  ./configure --prefix=/usr/local --enable-fhs
  make idl_full || return 1
  make || return 1
  make DESTDIR="$pkgdir/" install
}
md5sums=('0c25dced4dc64a6581a09917ec05dab2')

Next, libmapi. It depends on THIS SPECIFIC version of samba4, since the API is not yet stable AFAIK.

# Maintainer: ngoonee <n g    o o n    e e <at gmail.com, delete all spaces>>
pkgname=libmapi
pkgver=0.8.2
pkgrel=1
pkgdesc="Library for MAPI connectivity with Microsoft Exchange. This package was SPECIFICALLY created to support evolution-mapi and may not work for any other purpose."
arch=('i686' 'x86_64')
url="http://www.openchange.org"
license=('GPL3')
depends=('samba4=4.0.0A7')
options=(!makeflags)
source=(http://downloads.sourceforge.net/openchange/${pkgname}-${pkgver}-ROMULUS.tar.gz)

build() {
  cd ${srcdir}/${pkgname}-${pkgver}-ROMULUS
  ./autogen.sh
  export PKG_CONFIG_PATH=/usr/local/samba/lib/pkgconfig:$PKG_CONFIG_PATH
  ./configure --prefix=/usr/local
  make || return 1
  make DESTDIR="$pkgdir/" install
}
md5sums=('b956870860cd786a0793bd89783df185')

Finally, evolution-mapi itself. Again, depends on this specific version of libmapi. You'll need the next file (patch.patch) to fix some fairly nasty bugs with the released 0.28 (basically making it unuseable). Its the first four commits to evolution-mapi-git since the release, please feel free to check through it for any malicious code.

# Maintainer: ngoonee <n g    o o n    e e <at gmail.com, delete all spaces>>
pkgname=evolution-mapi
pkgver=0.28
pkgverminor=0
pkgrel=1
pkgdesc="MAPI plugin for evolution."
arch=('i686' 'x86_64')
url="http://www.go-evolution.org"
license=('GPL3')
depends=('libmapi=0.8.2')
options=(!makeflags)
source=(http://ftp.gnome.org/pub/gnome/sources/evolution-mapi/$pkgver/${pkgname}-${pkgver}.${pkgverminor}.tar.gz
        patch.patch)
md5sums=('275c505de979ae8ff27f62426867bad2'
         'a9503fb85427040ce421ea0bec0699ce')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}.${pkgverminor}
  export PKG_CONFIG_PATH=/usr/local/samba/lib/pkgconfig:$PKG_CONFIG_PATH
  export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
  patch -p0 < ${srcdir}/patch.patch

  ./configure --prefix=/usr/local
  make || return 1
  make DESTDIR="$pkgdir/" install

  # Create necessary symlinks, for files from libmapi and samba4 installs
  for i in libmapi libdcerpc libldb libndr libsamba-hostconfig; do
    ln -s ./${i}.so ${pkgdir}/usr/local/lib/${i}.so.0
  done
}

patch.patch

diff --git src/libexchangemapi/exchange-mapi-connection.c src/libexchangemapi/exchange-mapi-connection.c
index 900d736..20341d0 100644
--- src/libexchangemapi/exchange-mapi-connection.c
+++ src/libexchangemapi/exchange-mapi-connection.c
@@ -1211,7 +1211,7 @@ exchange_mapi_connection_fetch_items   (mapi_id_t fid,
 
         for (i = 0; i < SRowSet.cRows; i++) {
             mapi_object_t obj_message;
-            struct mapi_SPropValue_array properties_array;
+            struct mapi_SPropValue_array properties_array = {0};
             const mapi_id_t *pfid;
             const mapi_id_t    *pmid;
             const bool *has_attach = NULL;

diff --git src/libexchangemapi/exchange-mapi-connection.h src/libexchangemapi/exchange-mapi-connection.h
index 2059991..b2db6a8 100644
--- src/libexchangemapi/exchange-mapi-connection.h
+++ src/libexchangemapi/exchange-mapi-connection.h
@@ -37,7 +37,8 @@ typedef enum {
     MAPI_OPTIONS_FETCH_GAL = 1 <<4,
     MAPI_OPTIONS_DONT_SUBMIT = 1<<5, 
     MAPI_OPTIONS_GETBESTBODY = 1<<6,
-    MAPI_OPTIONS_USE_PFSTORE = 1<<7
+    MAPI_OPTIONS_USE_PFSTORE = 1<<7,
+    MAPI_OPTIONS_DONT_OPEN_MESSAGE = 1<<8
 } ExchangeMAPIOptions;
 
 #define MAPI_OPTIONS_FETCH_ALL MAPI_OPTIONS_FETCH_ATTACHMENTS | \


diff --git src/libexchangemapi/exchange-mapi-connection.c src/libexchangemapi/exchange-mapi-connection.c
index 20341d0..4c953bc 100644
--- src/libexchangemapi/exchange-mapi-connection.c
+++ src/libexchangemapi/exchange-mapi-connection.c
@@ -750,6 +750,8 @@ exchange_mapi_util_get_gal (GPtrArray *contacts_array)
     
     mem_ctx = talloc_init ("ExchangeMAPI_GetGAL");
 
+    LOCK ();
+
     SPropTagArray = set_SPropTagArray(mem_ctx, 0xc,
                       PR_INSTANCE_KEY,
                       PR_ENTRYID,


--- src/camel/camel-mapi-folder.c    2009-09-22 02:38:55.000000000 +0800
+++ src/camel/camel-mapi-folder.c    2009-09-24 19:18:19.000000000 +0800
@@ -178,10 +178,8 @@
 
 }
 
-
-/*Using GFunc*/
-static void 
-mapi_item_free (MapiItem *item, gpointer data)
+void 
+mapi_item_free (MapiItem *item)
 {
     g_free (item->header.subject);
     g_free (item->header.from);
@@ -196,6 +194,9 @@
 
     exchange_mapi_util_free_attachment_list (&item->attachments);
     exchange_mapi_util_free_stream_list (&item->generic_streams);
+    exchange_mapi_util_free_recipient_list (&item->recipients);
+
+    g_free (item);
 }
 
 static gboolean
@@ -351,8 +352,8 @@
     fi_data_mod_time.tv_usec = fi_data->last_modification_time.tv_usec;
 
     if (timeval_compare (&item_modification_time, &fi_data_mod_time) == 1) {
-            fi_data->last_modification_time.tv_sec = item_modification_time.tv_sec;
-            fi_data->last_modification_time.tv_usec = item_modification_time.tv_usec;
+        fi_data->last_modification_time.tv_sec = item_modification_time.tv_sec;
+        fi_data->last_modification_time.tv_usec = item_modification_time.tv_usec;
     }
 
     if ((*flags & MSGFLAG_READ) != 0)
@@ -483,7 +484,7 @@
     for ( ; item_list != NULL ; item_list = g_slist_next (item_list) ) {
         MapiItem *temp_item ;
         MapiItem *item;
-        gchar *msg_uid, *to = NULL, *from = NULL, *cc = NULL;
+        gchar *msg_uid;
         guint64 id;
 
         exists = FALSE;
@@ -522,6 +523,7 @@
         if (!exists) {
              GSList *l = NULL;
              guint32 count_to = 0, count_cc =0;
+            gchar *to = NULL, *cc = NULL;
 
             mi->info.uid = exchange_mapi_util_mapi_ids_to_uid(item->fid, item->mid);
             mi->info.subject = camel_pstring_strdup(item->header.subject);
@@ -565,8 +567,10 @@
                     switch (*type) {
                     case MAPI_TO:
                         if (count_to) {
+                            gchar *tmp = to;
                             to = g_strconcat (to, ", ", formatted_id, NULL);
                             g_free (formatted_id);
+                            g_free (tmp);
                         } else
                             to = formatted_id;
                         count_to ++;
@@ -574,8 +578,10 @@
 
                     case MAPI_CC:
                         if (count_cc) {
+                            gchar *tmp = cc;
                             cc = g_strconcat (cc, ", ", formatted_id, NULL);
                             g_free (formatted_id);
+                            g_free (tmp);
                         } else
                             cc = formatted_id;
                         count_cc ++;
@@ -600,15 +606,20 @@
                  item->header.from_email : item->header.from;
 
             if (item->header.from_email) {
-                from = camel_internet_address_format_address (item->header.from, 
-                                           item->header.from_email);
+                gchar *from = camel_internet_address_format_address (item->header.from, 
+                                             item->header.from_email);
                  mi->info.from = camel_pstring_strdup (from);
+
+                g_free (from);
             } else
                 mi->info.from = NULL;
 
             /* Fallback */
-             mi->info.to = to ? camel_pstring_strdup (to) : g_strdup (item->header.to);
-             mi->info.cc = to ? camel_pstring_strdup (cc) : g_strdup (item->header.cc);
+             mi->info.to = to ? camel_pstring_strdup (to) : camel_pstring_strdup (item->header.to);
+             mi->info.cc = cc ? camel_pstring_strdup (cc) : camel_pstring_strdup (item->header.cc);
+
+            g_free (to);
+            g_free (cc);
         }
 
         if (exists) {
@@ -691,7 +702,6 @@
     guint32 index, count, options = 0;
     GSList *server_uid_list = NULL;
     const gchar *uid = NULL;
-    GSList *tmp_list_item = NULL;
 
     /* Currently we don't have simple wrapper over getprops.*/
     const guint32 prop_list[] = { PR_LAST_MODIFICATION_TIME };
@@ -711,7 +721,7 @@
                            prop_list, G_N_ELEMENTS (prop_list),
                            NULL, NULL,
                            deleted_items_sync_cb, &server_uid_list,
-                           options);
+                           options | MAPI_OPTIONS_DONT_OPEN_MESSAGE);
 
     camel_operation_end (NULL);
 
@@ -728,6 +738,8 @@
 
     /* Iterate over cache and check if the UID is in server*/
     for (index = 0; index < count; index++) {
+        GSList *tmp_list_item = NULL;
+
         /*FIXME :Any other list available ???*/
         info = camel_folder_summary_index (m->folder->summary, index);
         if (!info) continue; /*This is bad. *Should* not happen*/
@@ -741,7 +753,7 @@
         }
 
         /* If it is not in server list, clean our cache */
-        if (!tmp_list_item->data && uid) {
+        if ((!tmp_list_item || !tmp_list_item->data) && uid) {
             CAMEL_MAPI_FOLDER_REC_LOCK (m->folder, cache_lock);
             camel_folder_summary_remove_uid (m->folder->summary, uid);
             camel_data_cache_remove (mapi_folder->cache, "cache", uid, NULL);
@@ -789,7 +801,7 @@
     CamelMessageInfo *info = NULL;
     CamelMapiMessageInfo *mapi_info = NULL;
 
-    GSList *read_items = NULL, *unread_items = NULL;
+    GSList *read_items = NULL, *unread_items = NULL, *to_free = NULL;
     flags_diff_t diff, unset_flags;
     const char *folder_id;
     mapi_id_t fid, deleted_items_fid;
@@ -830,40 +842,55 @@
             mapi_id_t *mid = g_new0 (mapi_id_t, 1); /* FIXME : */
             mapi_id_t temp_fid;
             guint32 flags;
+            gboolean used = FALSE;
 
             uid = camel_message_info_uid (info);
             flags= camel_message_info_flags (info);
 
             /* Why are we getting so much noise here :-/ */
-            if (!exchange_mapi_util_mapi_ids_from_uid (uid, &temp_fid, mid))
+            if (!exchange_mapi_util_mapi_ids_from_uid (uid, &temp_fid, mid)) {
+                g_free (mid);
                 continue;
+            }
 
             mapi_utils_do_flags_diff (&diff, mapi_info->server_flags, mapi_info->info.flags);
             mapi_utils_do_flags_diff (&unset_flags, flags, mapi_info->server_flags);
 
             diff.changed &= folder->permanent_flags;
             if (!diff.changed) {
-                camel_message_info_free(info);
+                camel_message_info_free (info);
+                g_free (mid);
                 continue;
             } else {
                 if (diff.bits & CAMEL_MESSAGE_DELETED) {
-                    if (diff.bits & CAMEL_MESSAGE_SEEN) 
+                    if (diff.bits & CAMEL_MESSAGE_SEEN) {
                         read_items = g_slist_prepend (read_items, mid);
-                    if (deleted_items)
+                        used = TRUE;
+                    }
+                    if (deleted_items) {
                         deleted_items = g_slist_prepend (deleted_items, mid);
-                    else {
+                        used = TRUE;
+                    } else {
                         g_slist_free (deleted_head);
                         deleted_head = NULL;
                         deleted_head = deleted_items = g_slist_prepend (deleted_items, mid);
+                        used = TRUE;
                     }
                 }
             }
 
             if (diff.bits & CAMEL_MESSAGE_SEEN) {
                 read_items = g_slist_prepend (read_items, mid);
+                used = TRUE;
             } else if (unset_flags.bits & CAMEL_MESSAGE_SEEN) {
                 unread_items = g_slist_prepend (unread_items, mid);
+                used = TRUE;
             }
+
+            if (used)
+                to_free = g_slist_prepend (to_free, mid);
+            else
+                g_free (mid);
         }
         camel_message_info_free (info);
     }
@@ -908,10 +935,11 @@
         deleted_items = g_slist_next (deleted_items);
     }
 
-    if (unread_items) {
-        /* TODO */
-        g_slist_free (unread_items);
-    }
+    g_slist_free (unread_items);
+    g_slist_free (deleted_head);
+
+    g_slist_foreach (to_free, (GFunc) g_free, NULL);
+    g_slist_free (to_free);
 
     if (expunge) {
         /* TODO */
@@ -1054,6 +1082,7 @@
         }
 
         /*Preserve last_modification_time from this fetch for later use with restrictions.*/
+        g_free (mapi_summary->sync_time_stamp);
         mapi_summary->sync_time_stamp = g_time_val_to_iso8601 (&fetch_data->last_modification_time);
 
         camel_folder_summary_touch (folder->summary);
@@ -1292,6 +1321,8 @@
         item->msg.body_parts = g_slist_append (item->msg.body_parts, body);
 
         item->is_cal = TRUE;
+
+        g_free (appointment_body_str);
     } else { 
         if (!((body = exchange_mapi_util_find_stream (item_data->streams, PR_HTML)) || 
               (body = exchange_mapi_util_find_stream (item_data->streams, PR_BODY))))
@@ -1374,7 +1405,8 @@
             camel_internet_address_add (bcc_addr, display_name, recip->email_id);
             break;
         }
-        /* g_free (display_name); */
+
+        g_free (display_name);
     }
     
     /*Add to message*/
@@ -1395,22 +1427,35 @@
     CamelInternetAddress *addr = NULL;
     CamelMapiStore *mapi_store = CAMEL_MAPI_STORE(folder->parent_store);
     int offset = 0;
-    guint i;
     time_t actual_time;
 
     /* Setting headers from PR_TRANSPORT_MESSAGE_HEADERS */
     if (item->header.transport_headers) {
-        struct _camel_header_raw *headers;
-        gchar **header_list;
+        CamelMimePart *part = camel_mime_part_new ();
+        CamelStream *stream;
+        CamelMimeParser *parser;
+
+        stream = camel_stream_mem_new_with_buffer (item->header.transport_headers, strlen (item->header.transport_headers));
+        parser = camel_mime_parser_new ();
+        camel_mime_parser_init_with_stream (parser, stream);
+        camel_mime_parser_scan_from (parser, FALSE);
+        camel_object_unref (stream);
+
+        if (camel_mime_part_construct_from_parser (part, parser) != -1) {
+            struct _camel_header_raw *h;
+
+            for (h = part->headers; h; h = h->next) {
+                const gchar *value = h->value;
+
+                while (value && camel_mime_is_lwsp (*value))
+                    value++;
 
-        header_list = g_strsplit (item->header.transport_headers, "\n", -1);
-        for (i = 0; header_list && header_list [i]; i++)
-            camel_header_raw_append_parse (&headers, header_list[i], -1);
-
-        while (headers->next) {
-            camel_medium_add_header (CAMEL_MEDIUM (msg), headers->name, headers->value);
-            headers = headers->next ;
+                camel_medium_add_header (CAMEL_MEDIUM (msg), h->name, value);
+            }
         }
+
+        camel_object_unref (parser);
+        camel_object_unref (part);
     }
 
     /* Overwrite headers if we have specific properties available*/
@@ -1579,7 +1624,6 @@
             camel_object_unref (part);
             
         }
-        exchange_mapi_util_free_attachment_list (&attach_list);
     }
 
     camel_medium_set_content_object(CAMEL_MEDIUM (msg), CAMEL_DATA_WRAPPER(multipart));
@@ -1682,10 +1726,7 @@
     }
 
     msg = mapi_folder_item_to_msg (folder, item, ex);
-
-    exchange_mapi_util_free_recipient_list (&item->recipients);
-
-    g_free (item);
+    mapi_item_free (item);
 
     if (!msg) {
         camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Could not get message"));
@@ -1975,7 +2016,7 @@
 
     if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
         camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, 
-                 _("Offline. '%s'"));
+                      _("Offline."));
         return;
     }

I formerly posted up evolution-mapi-2.26 in another thread, but I thought community contributions would be a better place for this. Enjoy.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#5 2009-11-12 12:48:16

gesocks
Member
Registered: 2009-11-12
Posts: 4

Re: Evolution-mapi 2.30 (Please read before using)

ngoonee wrote:

Sorry, should have been more clear. samba4 installs into /usr/samba (according to FHS), which conflicts with samba 3 (what we're having now). According to the devs, samba4 is not feature-complete relative to samba 3, therefore its an either/or. Samba 3.4 supposedly has the best of both worlds, though. I have not tried to install evolution-mapi on that, as yet, since it has not hit our repos (nor does it look like its going to), and the install looks... difficult, to say the least.

Hi,

samba 3.4 hit repo a few days ago. Has someone tried evolution mapi with it?

Greets

Offline

#6 2009-11-12 12:56:26

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Evolution-mapi 2.30 (Please read before using)

gesocks wrote:
ngoonee wrote:

Sorry, should have been more clear. samba4 installs into /usr/samba (according to FHS), which conflicts with samba 3 (what we're having now). According to the devs, samba4 is not feature-complete relative to samba 3, therefore its an either/or. Samba 3.4 supposedly has the best of both worlds, though. I have not tried to install evolution-mapi on that, as yet, since it has not hit our repos (nor does it look like its going to), and the install looks... difficult, to say the least.

Hi,

samba 3.4 hit repo a few days ago. Has someone tried evolution mapi with it?

Greets

I saw it, but haven't had time to try, nor motivation. My university has agreed to open up IMAP for the server smile.

Will look into it, hopefully.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#7 2010-04-13 06:13:49

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Evolution-mapi 2.30 (Please read before using)

Updated for 2.30, openchange 0.9, and samba4alpha10. Works on basic testing on my machine, but I don't use it actively anymore, hence I'm not bothered to try samba 3.5 (current in extra) in the shared mode.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#8 2010-04-19 18:07:57

peku2455
Member
Registered: 2010-04-19
Posts: 1

Re: Evolution-mapi 2.30 (Please read before using)

I am  getting error on authentication with a exchange 2010 server
"Authentication failed.
MapiLogonProvider:MAPI_E_LOGON_FAILED"

Last edited by peku2455 (2010-04-19 20:07:47)

Offline

#9 2010-04-20 00:23:09

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Evolution-mapi 2.30 (Please read before using)

Not sure if it supports Exchange 2010 yet, you'd have to google around to find out. Evolution-mapi was specifically for supporting Exchange 2007 initially.

Perhaps the problem is more you're inputting the wrong login details though. Perhaps add your domain name before or something like that.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#10 2010-04-20 09:05:01

WladyX
Member
Registered: 2008-10-26
Posts: 43

Re: Evolution-mapi 2.30 (Please read before using)

peku2455 wrote:

I am  getting error on authentication with a exchange 2010 server
"Authentication failed.
MapiLogonProvider:MAPI_E_LOGON_FAILED"

I get this too on Ubuntu 10.04 and Exchange 2010.

Offline

#11 2010-04-20 09:44:29

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Evolution-mapi 2.30 (Please read before using)

WladyX wrote:
peku2455 wrote:

I am  getting error on authentication with a exchange 2010 server
"Authentication failed.
MapiLogonProvider:MAPI_E_LOGON_FAILED"

I get this too on Ubuntu 10.04 and Exchange 2010.

Hence an evo-mapi problem. Try and see what a google turns up, or go visit their IRC.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#12 2010-05-28 13:15:42

gechu
Member
Registered: 2010-05-27
Posts: 8

Re: Evolution-mapi 2.30 (Please read before using)

Just tried these PKGBUILDs for Exchange 2007, and the work! Thanks ngoonee!

Offline

#13 2010-05-28 14:46:50

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Evolution-mapi 2.30 (Please read before using)

You're welcome.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#14 2010-08-04 21:59:11

gobeav3rs297
Member
From: Portland Oregon
Registered: 2007-11-06
Posts: 60

Re: Evolution-mapi 2.30 (Please read before using)

hi tried PKGBUILDS provided by you, compiled/installed successfully.  However when i go to evolution and try to create an account i can't seem to find the Exchange MAPI server option.  I only see IMAP and IMAP+ option among the others.  I have Evolution 2.30.2 installed.   Any idea what's going on?

Offline

#15 2010-08-04 22:25:18

gobeav3rs297
Member
From: Portland Oregon
Registered: 2007-11-06
Posts: 60

Re: Evolution-mapi 2.30 (Please read before using)

nevermind, got it solved.

Offline

#16 2010-10-22 20:55:53

jholbrook
Member
Registered: 2010-07-08
Posts: 18

Re: Evolution-mapi 2.30 (Please read before using)

gobeav3rs297 wrote:

nevermind, got it solved.

AAAGGGHHHHHH!!! DO YOU KNOW HOW FLIPPIN' IRRITATING IT IS WHEN SOMEBODY SAYS "Never mind. Fixed it."

Think about it!! Other people may have the same problem that you're having. Post what you did to fix the problem please!!

Offline

#17 2010-10-22 22:35:58

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Evolution-mapi 2.30 (Please read before using)

jholbrook wrote:
gobeav3rs297 wrote:

nevermind, got it solved.

AAAGGGHHHHHH!!! DO YOU KNOW HOW FLIPPIN' IRRITATING IT IS WHEN SOMEBODY SAYS "Never mind. Fixed it."

Think about it!! Other people may have the same problem that you're having. Post what you did to fix the problem please!!

All the versions have changed since he posted. If you're completely up-to-date (and using samba4-openchange instead of samba4) then this should just work. It does for me. Account type is 'Microsoft Exchange'.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#18 2011-01-07 14:56:25

scales
Member
Registered: 2008-07-16
Posts: 22

Re: Evolution-mapi 2.30 (Please read before using)

Hi all,
Sorry to dig up an older thread.  I read through the whole thing and tried to install samba4 first but am getting errors about it not compiling.  I think it needs python 2.4 or 2.6...
Isnt the default python 3.1?  I am installing that and will try with it now, but I was wondering if my interpretation of installing samba4, then openchange, then evolution-mapi was correct.

Thanks, and man I just wish this package was out of aur and easier to setup.

EDIT: Just tried after installing python 3.1, no luck.

complete output from attempting samba4 here:
http://pastebin.ca/2040343

Last edited by scales (2011-01-07 15:00:05)

Offline

#19 2011-01-07 15:24:30

a1russell
Member
Registered: 2010-07-14
Posts: 7

Re: Evolution-mapi 2.30 (Please read before using)

scales wrote:

Thanks, and man I just wish this package was out of aur and easier to setup.

Based on these PKGBUILDs, I actually did submit some packages to AUR, which ngoonee is now maintaining.

samba4 - http://aur.archlinux.org/packages.php?ID=40043
openchange - http://aur.archlinux.org/packages.php?ID=40069
evolution-mapi - http://aur.archlinux.org/packages.php?ID=40045

Offline

#20 2011-01-07 16:02:47

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Evolution-mapi 2.30 (Please read before using)

Yes I forgot all about this thread. Added a note at the top. @scales, feel free to install from the AUR (question: why didn't you search it in the first place?) and post any problems you have there to a new forum thread or to the AUR comments. I'll close this (really old) thread.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB