Setting up my ideal email system

Recently I have managed to get pretty much my ideal email system set up. This is the kind of thing that would simply be impossible on a Windows box, but (when you know how) is a quick job on Linux. I didn’t know how, but now I do (ish). I’m going to do it in separate installments, trying to make them slightly self-contained.

Setting up an IMAP server

I chose Dovecot because it looked fairly good, and it came high up on Google. Installing it on Fedora Core 3 was just:

yum install dovecot

But then I needed to set up the config file. The only thing I changed looked like this:

default_mail_env = maildir:~/Maildir

I did this because after reading the scare stories about locking when using an mbox-type mailbox, I decided Maildir sounded safer. Maildir holds each mail in a separate file, which sounds good for preventing corruption if something goes wrong, so I chose it. It seems to work ok.

I left the passwords to be plain text for the moment, which meant my /etc/imap.passwd had to look like this:

brian:{PLAIN}sausages:500:500::/home/brian

Where ‘brian’ would be your username and ‘sausages’ the password you have decided to use for mail. If you’re using plain text passwords, don’t use the same password as your login password, because any old packet sniffer will be able to see the mail password.

With this set up, I had a working IMAP server which stored messages in my home dir under the ~/Maildir directory. Of course, there were no messages in there at the moment – that’s coming up later. Next time, how I made Mozilla Thunderbird see the messages stored there!

Python objects in C++

Sometime I find myself thinking in Python. Or, accurately, wistfully thinking of Python. Raw C++ is completely hamstrung when it comes to simple concepts like handling strings or dealing with lists (maybe BOOST is better?). Why can’t I just do this:

remaining_args = sys.argv[3:7]

I don’t even mind if it looks like this:

PyList argv = new PyList( argv, argc );
PyList remaining_args = argv.slice( 3, 7 );

Is this kind of thing possible? If not, someone really should package up the Python library in such a way that it is.

Of course, I’m speaking from a position of total ignorance here: maybe someone has done what I’m talking about with the Python stuff. After a brief look at BOOST, I can say for sure that it continues the STL’s tactic of “under-use through obscurity” and “surprisingly missing all the useful features”. No slice operator, anyway…

If they have done/do do the Python thing, the most frustrating part then is going to be wishing you could have all the bits of the Python library that are written in Python. Does anyone fancy starting the “GCP” project?

CD writing on Fedora Core 3

I’m now thing of moving off Fedora Core 3 (probably to Ubuntu, or maybe FC4 for the Java stuff) and it turns out I’ve never written a CD from it, because when I tried it didn’t work: I kept getting the message “cdrecord: Success. Cannot open SCSI driver.” I finally managed to find a solution. For some reason I need to do this:

cdrecord dev=ATA:1,1,0 -eject -v speed=2 ubuntu-5.04-live-i386.iso

Note the ATA: in the dev bit. No idea why.