The software is updated at 2010/10/05.

I use Evolution with Microsoft exchange server in office for 2 years. It’s a pretty good software which is integrated mail, addressbook and calendaring functionality, a groupware suite that all I need for office productivity.

However, when you use a email client for a long time, the e-mails will take more and more disk space. Especially, when you exchange many attachments with the other people. I have to keep the e-mails for record, but the attachments are all filed. I don’t want them to take my disk space anymore. I would like to save some space for really important project. It’s time to get rid of them. I need a plugin for remove these attachments.

I did some research on evolution mailing list. It seems some people discuss about this kind plugin. But it does not been done before. The project page provides some document about EPlugin framework, it’s easy to write a plugin for evolution. Therefore I wrote one for myself.

This plugin is pretty small, it’s about 150 lines of C code. You can download remove-attachments-0.0.1.tar.gz from this url. I did not provide a makefile for build it, you have to put this plugin in evolution source tree. It will generate make file for compile this plugin, if you know how to modify the automake/autoconf config files.

Basically, you have to add the makefile path for the plugin in evolution/, and add a sub-directory in evolution/plugins/ After that, you have to execute autoconf and automake to update the configure script and makefiles.

Here are some screen-shot, this is a email which contains a deb file. The email is 3.1MB.

Email with a attachment.

You can select one or many emails, and click right button. The pop menu will contains a function named “Remove attachment”. Click it.


The plugin will keep the attachment filename, but change the content into a text say “The file has been removed”. And you can see the email size turn to 1k. 😀

Email with a attachment which has been deleted.

The source code is licensed under the GNU GPL v2 or later. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM. I try this with local and exchange mailbox, it works fine. It’s beta and it’s the first version, don’t use this software for production.

The software is updated at 2010/10/05.

  • nick

    the whole point of a plugin is that you just plug it in, not to recompile the damn thing

    can you post a .so ?

  • The whole point of the open source is that you can just download the source code and compile it, would you please compile the damn .so ?

  • xian

    Could you please provide a more detailed guide for compilation? I dowloaded evolution source (apt-get source evolution), copied remove-attachments directory into plugins, extended plugins/ and What next? I tried autoconf;automake but can not see any difference, no Makefile written. Do I need all the devel packages required for evolution build? Should I run configure? Should I run make (for the whole evolution tree)?

  • I’m not familiar with the autotools, so I wasn’t able to follow your instructions. Could you please publish a tarball which I could compile with a simple “./configure; make; make install”? I’m very interesting in this plugin!

  • Peter

    Works great!! Thank you, i was waiting so long for this (loved that feature in Eudora)!!!

  • Hank Hampel

    Hi Rex,

    you actually programmed my “most wanted” plugin for evolution – it is really great to be able to remove attachments (like I was in mutt).

    I’ve used it previously with Ubuntu Dapper but now had to re-install my laptop and thought that I could fix some minor annoyances – two spelling mistakes (“Remove Attachments” instead of “Remote Attachments”) and that the plugin was not able to remove “inline” attached content.

    As the “inline” attaching seems to be the standard for Thunderbird and Lotus Notes (if I’m not mistaken on that one) I couldn’t remove half of all the attachments as many emails come from those clients.

    If you are interested in said patches (which change only three lines of code) just drop me a short email and I’ll send them to you.

    Thanks again and keep up the good work!

    Best regards, Hank

  • Dick Dunbar

    Rex, Hank, Pete, (or anybody except chihchun)

    I agree with nick. I’m a heavy user of Evoultion, and my folders are filled with attachments, but I have no idea how to go about compiling this much-desired plugin. If one of you who do have that knowledge could construct the plugin file (.so) and make it available to the rest of us who are not familiar with integrating something “into the Evolution source tree”, etc., it would be a great help. Another part of the open source community is sharing and helping others, something chihchun seems o have forgotten, or ignored.

  • @Dick, I am happy to do so, if the anonymous reader ask me nicely. Open source developer does not have responsibility to service the users, especially the developer don’t have too much free time on maintaining the package.

    BTW, chihchun is Rex.

  • Rex,

    Boy, now I’m REALLY glad I didn’t send that last message the way I originally composed it!;^) Seriously, this business of not being able to remove attachments is the one thing that really bugs me about Evolution. I have a web site where I display photos of towboats from contributors, and I get tons of photos attached to emails. Hardly a day goes by that I don’t receive a few, and some days I can’t count them all. I’m pretty handy with shell scripts and php, and I know enough perl to fiddle with scripts to customize them, but I don’t want to get into modifying source code so that the next time I upgrade Ubuntu, I have to go back and do it all over again, after I’ve forgotten how it was done in the first place. A plugin is something else again, though. I can deal with that. That’s why I’d like to see this taken to the next level, so that folks like me can make use of it, too. Pretty please?

  • @Dick, I spent two hours without sleep last night working on it. I will release it today (hopefully). 🙂

  • Norm Dressler

    This is great– it almost does what I really want. I get email forwarded by Exchange Server as an attachment. What I really want to do is move just the attachment to a folder. Know of any nice little Eplugin that will do that or even an external script that will ‘strip’ off the email or forward the email attachment? Just a thought…


  • @Norm, move the attachment to another folder? But there should be still the message body, what do you want to do with the subject and body?

  • Norm Dressler

    The process is that the inbound message is a forwarded message. The Forwarded message is the attachment. By moving the attachment, it strips the wrapper email that was used to send it from one email account to another. When I manually move the attachment to a folder, it shows exactly like the original email. Hope that helps!

  • Hi,

    I’m running Ubuntu 8.04 64bit, and I tried compiling evolution-remove-attachments-0.0.2. I got the following output:

    [email protected]:~/downloads/evolution-remove-attachments-0.0.2$ make
    make all-recursive
    make[1]: Map ‘/home/amedee/downloads/evolution-remove-attachments-0.0.2’ wordt binnengegaan
    Making all in src
    make[2]: Map ‘/home/amedee/downloads/evolution-remove-attachments-0.0.2/src’ wordt binnengegaan
    make all-am
    make[3]: Map ‘/home/amedee/downloads/evolution-remove-attachments-0.0.2/src’ wordt binnengegaan
    /bin/bash ../libtool –tag=CC –mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I $(pkg-config –cflags evolution-plugin) -I.. -g -O2 -MT remove-attachments.lo -MD -MP -MF .deps/remove-attachments.Tpo -c -o remove-attachments.lo remove-attachments.c
    gcc -DHAVE_CONFIG_H -I. -I.. -I -DORBIT2=1 -pthread -DPNG_NO_MMX_CODE -I/usr/include/evolution-2.22 -I/usr/include/libgnome-2.0 -I/usr/include/libgnomeui-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/evolution-data-server-2.22 -I/usr/include/libxml2 -I/usr/include/orbit-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libart-2.0 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/pango-1.0 -I/usr/include/gail-1.0 -I/usr/include/freetype2 -I/usr/include/atk-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/pixman-1 -I.. -g -O2 -MT remove-attachments.lo -MD -MP -MF .deps/remove-attachments.Tpo -c remove-attachments.c -fPIC -DPIC -o .libs/remove-attachments.o
    remove-attachments.c:13:55: fout: libedataserverui/e-source-selector-dialog.h: Bestand of map bestaat niet
    make[3]: *** [remove-attachments.lo] Fout 1
    make[3]: Map ‘/home/amedee/downloads/evolution-remove-attachments-0.0.2/src’ wordt verlaten
    make[2]: *** [all] Fout 2
    make[2]: Map ‘/home/amedee/downloads/evolution-remove-attachments-0.0.2/src’ wordt verlaten
    make[1]: *** [all-recursive] Fout 1
    make[1]: Map ‘/home/amedee/downloads/evolution-remove-attachments-0.0.2’ wordt verlaten
    make: *** [all] Fout 2

    I suppose libedataserverui/e-source-selector-dialog.h is some -dev file that I’m missing? I installed evolution-dev and that pulled in a lot of other -dev packages, so what am I missing here?

  • Hi,Amedee
    You need libedataserverui1.2-dev. 🙂

  • Thanks for this good plugin, it works very well!

  • rikkirich


    The plug-in is one of the useful plugs for evolution but, it works fine only up to evolution 2.28.x!

    From 2.30-version, the package evolution-dev is missing the files:
    “em-menu.h, em-popup.h” and “e-menu.h, e-popup.h”. Farther the functions “EMPopupTargetSelect” and “EMMenuTargetSelect” are no more in use.

    This files/functions are needed to build the plug-in.

    I’m not a programmer and I have no idea how to fix this problems, could you help?