Tag Archives: contacts

Fetchmail, Dovecot and OpenLDAP

The last few weeks I’ve been working on a server that I can access mail from regardless of which machine I’m on, what OS I load or where I’m at. Now yes the thoughts running through ones head is you can also do it with about any of the major email hosts google, yahoo, hotmail, not to mention a number of ISP’s. The difference is I wanted to have the data in a place that I could physically touch on my own equipment to modify as I see fit. Not to mention it sounded like a decent challenge too. Applications already exist to do this and since I’m not going with an all in one solution I’ll need a few separate programs to do the job. That’s where Fetchmail, Dovecot and LDAP will do all the work.

I’ve read about Fetchmail for years but never took the time to put it to work. The same would go for Dovecot (IMAP) and LDAP.

How they all work is Fetchmail will “fetch” mail from the various addresses I have and store all the messages in one place. To read the mail with a standard client I needed IMAP, this what Dovecot will do. Lastly, which is a bonus, is LDAP for contacts and for this we can use slapd to implement OpenLDAP.

Fetchmail

Their is plenty of resources on the net for this already one that helped me was this post, simple and straight forward. My setup barley scratches the surface of what this app can do, but for now simple does the trick.

Dovecot

Dovecot is an IMAP and POP3 package it will take care of the access, it can be configured for unsecure, secure or both. This setup was a little more tricky for me. After installing I was able to get access but no mail or folders would show up. It took me a little time, in the end it was this that solved the problem. I enabled the following line in dovecot.conf

default_mail_env = mbox:~/mail/:INBOX=/var/mail/%u 

.. and I had access. What’s nice here is all I have to do is create a folder on the IMAP side and copy / paste the messages from the folder on my machine. Now they are all on the server and I can access them from any machine / device on my network or if I’m travelling.

OpenLDAP

The most challenging of these has been LDAP. This is another protocol I haven’t had an opportunity to do much with. For this I installed slapd and immediately began fighting with the setup. LDAP is one of those apps that is very robust and with so many options and ways to do things it’s difficult to weed your way through. This article was very helpful. When I got to the section that talks about ldapadd I could not execute it, that app was not part of the slapd package. It took me a little time to figure that out and once I added it, and loaded the ldif file things were better.

But then the problems started with Evolution and accessing the LDAP directory. Response was slow and would only work a few times until I restarted. I was hoping this was a configuration issue but then I found this bug and was immediately disappointed.

However I figured their had to be a resolution and since I was using version 2.22 I thought maybe 2.24 had a fix. Both Ubuntu Intrepid and Fedora 10 come with 2.24 and I have a drive that I just loaded F10 on. Before swapping I did some more googling I found reference to a patch that recently had been applied so I was hopeful 2.24 was ok. Unfortunately I can’t find the reference and didn’t make note of it at the time. But I believe it was a thread on the Gnome Evolution Hackers list and the fix is included in this release. So after putting in my drive with F10 and adding the LDAP address book response was much better and no time outs. So far it’s looking good.

That leaves me with a question, move to 2.24 or live with 2.22. I’d like to keep all contacts in a central location so I’ll have to look into upgrading Evolution to 2.24 on Lenny. Regardless I’m pleased and it was an excellent learning experience.

vcf2ldif … time saver

I’ve been using Thunderbird for years now on Windows, managing email for work. For me it’s more efficient and I can find things faster. However for personal mail I’ve always used Evolution even back when it was Ximian. It is an excellent PIM and has served me well over the years. But I decided to switch to Thunderbird the other day. The main reason is for simplicity and managing upgrades a little easier.

So moving mail wasn’t a big deal both use mbox format, copy the files that’s it, but contacts was another story. So my delima was add contacts manually or find a way to convert. Evolution can export contacts in CSV or VCF format but Thunderbird can only import CSV or LDIF. One might say no problem use CSV as it’s common with both. Well for me that wasn’t the case as the Evo export had some interesting labeling and when walking through the Thunderbird import more fields were wrong than right.

I wasn’t really ready to do that so I went looking for a way to convert VCF to LDIF. That’s when I found vcf2ldif. Cudos to Ryan Mills for creating this Java app as it did the trick and saved hours of manual work. I ran into a couple of errors on some address books relating to the number of fields per record, or so it seemed. But removing unnecessary lines in the VCF files fixed it.

SWEET !!!

Evolution contacts backup problem

I have used Novell Evolution for a few years now and it is an excellent PIM (Personal Information Manager). Other than a bone head move a few weeks ago, which killed all my email and contacts, I have not had any problems.

It had nothing to do with Evolution and I was able to restore from a backup. It was just frustrating more than anything. I guess that is a good argument for backing data up… ;)

Today however I loaded Ubuntu on a spare drive and when restoring .evolution one address book was gone. I thought that was very strange since /$HOME/.evolution/addressbook/local/ contained a folder other than system and it had addressbook.db and addressbook.db.summary. I tried creating the address book in Evolution and then manually copying the .db and .db.summary files into it, but no luck.

I did a little googling and came across a few posts that commented about shutting down the Evolution database server and restarting. This seemed like a logical thing to do, however I would have thought a reboot would have done the same but none the less I was game.
Find the PID of the server. Kill it and restart Evolution.

$ ps -ef | grep Evolution_DataServer
nobody     9657     1  0 20:02 ?        00:00:00 /usr/lib/evolution

/evolution-data-server-1.2
--oaf-activate-iid=OAFIID:GNOME_Evolution_DataServer_InterfaceCheck
 --oaf-ior-fd=50

$ kill -9 9657

Initially that did not do the trick so I decided to create the address book empty and then move addressbook.db and addressbook.db.summary into the new folder. After adding the address book I had to kill the DataServer again to get new folder to appear in .evolution/addressbook/local. Once I moved the new files to the new folder and restarted Evolution, both address books were there.