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.

Leave a Reply

Your email address will not be published. Required fields are marked *

WP-SpamFree by Pole Position Marketing