MAPI is Evolving

Posted by dave
on Tuesday, March 16

Recent changes to the email infrastructure around here have meant that those of us on Linux still have some troubles. The Exchange 2007 MAPI connector seems to work pretty well for Mac users, but Evolution’s MAPI provider plugin in Ubuntu 9.10 doesn’t work particularly well at present. It screws up calendars and inserts some strange entities (”=20”) on line breaks in emails, making us seem even geekier than we actually are.

On the upside, Evolution doesn’t freak out very often, as it did with the Exchange 2003 connector. So what happens if we try and compile the MAPI connector from source?

#!/bin/sh

#Shut down all running evolution processes
evolution --force-shutdown

# Make somewhere for the source code to live
mkdir ~/evolution
cd ~/evolution

#Download source code from gnome-evolution project page
wget http://download.gnome.org/sources/evolution-mapi/0.28/evolution-mapi-0.28.3.tar.bz2
wget http://download.gnome.org/sources/gtkhtml/3.28/gtkhtml-3.28.3.tar.bz2

#Remove evolution-MAPI package
sudo apt-get remove evolution-mapi

#Install needed dependencies for compilation
sudo apt-get install libdb-dev libnspr4-dev libnss3-dev libical-dev libsqlite3-dev
sudo apt-get install bison intltool gnome-core-devel evolution-data-server-dev 
sudo apt-get install libcanberra-gtk-dev
sudo apt-get install libgtkhtml3.8-dev network-manager-dev libunique-dev libhal-dev
sudo apt-get install libgtkimageview-dev libpst-dev libnotify-dev
sudo apt-get install libmapi-dev samba4-dev libglib2.0-dev
sudo apt-get install libebackend1.2-dev libecal1.2-dev libedataserver1.2-dev
sudo apt-get install  libedata-cal1.2-dev  libebook1.2-dev libedata-book1.2-dev
sudo apt-get install libcamel1.2-dev evolution-dev libedataserverui1.2-dev

# Compile gtkhtml
tar fxj gtkhtml-3.28.3.tar.bz2
cd gtkhtml-3.28.3
./configure && make && sudo make install
cd ..

# Compile the mapi plugin
tar fxj evolution-mapi-0.28.3.tar.bz2
cd evolution-mapi-0.28.3
./configure && make && sudo make install
cd ..

# Now you can just start evolution normally and enjoy some improvements!

Calendar invites still screw up and disappear randomly, but at least emails don’t have weird entities strewn all through them, making me feel a little better about things. Hopefully this package will get some love in the forthcoming Ubuntu 10.04! Thanks to the Ubuntu Forums people for providing partial instructions for how to compile these packages (I’ve turned that forum post into a shell script that should hopefully work for most people).

Important Note: this process only works if you’ve already got your Exchange MAPI account set up and properly configured. Installing the evolution-mapi-0.28.3 plugin breaks the UI which is used to enter your account details right at the start of the Evolution setup process, making it impossible to set up any kind of account. This somewhat sucks but I guess if you’ve already got your account set up, it won’t make much difference to you.

The shell script, ready to go, is here. If it eats your dog or provokes an existential crisis, you can back out of the changes it makes like so:

evolution --force-shutdown
cd ~/.evolution
cd evolution-mapi-0.28.3 && sudo make uninstall && cd ..  
cd gtkhtml-3.28.3  && sudo make uninstall && cd .. 
sudo apt-get install exchange-mapi

QCT - Back in Action

Posted by dave
on Friday, November 20

Ubuntu releases with broken versions of the QCT Commit Tool appear to be something of a tradition, and Ubuntu 9.10 (Karmic Koala) is no exception. Qct is an easy to use, very lightweight commit tool which I always find myself reaching for when doing commits these days, and I go a bit mental when I need to use subversion and it’s not around. Anway, to the problem:

chimp@boomer:~/workspace/projectname $ qct
Auto-detected Subversion repository

Qct fires up, I type in a commit message, and select which files I want to commit. Everything looks good until we hit the “commit” button:

Error code 1 not expected
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/qctlib/gui_logic.py", line 801, in commitSelected
    self.vcs.commitFiles(checkedItemList, msg)
  File "/usr/lib/pymodules/python2.6/qctlib/vcs/svn.py", line 231, in commitFiles
    runProgram([self.svn_exe, 'commit', '-F', filename] + commitFileNames)
  File "/usr/lib/pymodules/python2.6/qctlib/utils.py", line 143, in runProgram
    raise ProgramError(progStr, out)
qctlib.utils.ProgramError: svn commit -F /tmp/tmpChpKyU  app/controllers/application_controller.rb: svn: '/home/chimp/workspace/projectname/ app/controllers' is not a working copy
svn: '/home/chimp/workspace/projectname/ app/controllers' does not exist

Note the space between projectname and app. An older version of qct is not loving the new subversion 1.6 in Ubuntu, which brings some new options with it. Ok, time for the source tarball off of http://qct.sourceforge.net. To compile it, you’ll need to sudo apt-get install pyqt4-dev-tools, then cd into the source directory and run sudo make site-install to install it system-wide. Did you do that? Bad news for not reading ahead, because attempting to use that qct binary gets you:

chimp@boomer:~/workspace/projectname$ qct
Traceback (most recent call last):
  File "/usr/local/bin/qct", line 13, in <module>
    from qctlib.gui_logic import CommitTool
  File "/usr/local/lib/python2.6/dist-packages/qctlib/gui_logic.py", line 9, in <module>
    from qctlib.ui_dialog import Ui_commitToolDialog
ImportError: cannot import name Ui_commitToolDialog

So, that one doesn’t even fire up.

Lastly, I grabbed the latest source for the project:

sudo apt-get install mercurial  pyqt4-dev-tools
hg clone http://bitbucket.org/sborho/qct/
cd qct
sudo make site-install

Don’t forget to apt-get install pyqt4-dev-tools first, or that’ll blow.

The latest source appears to work fine, very many thanks to the author Steve Borho for this great little tool.