repak shawahb
I like to think of myself as the master of my own destiny

^

   

rsw@jfet.org


blogroll

       
Mon, 24 Jan 2005

total hotness

Those of you who run your own mailserver might be interested to learn that I've slogged through the (surprisingly pleasant) installation of a webmail interface on positron that manages to coexist perfectly with my normal method of access, viz., ssh+mutt. Moreover, in the process I ended up setting up a SSL/TLS-enabled IMAP server so that I can actually use mutt (or some other SSL-enabled IMAP client) on pretty much any machine and it'll make a secure connection and (with an appropriate .muttrc) behave just like the local one.

First things first: imapd. This is incredibly easy:

[root@positron ~]# apt-get install uw-imapd-ssl

You may be asked to install some ancillary packages. Use your best judgement. After that, assuming you already have apache2, SSL, and mysqld up and running (not gonna help you with this; a google search should suffice), just

[root@positron ~]# apt-get install imp3

Note that you'll need a bunch of other stuff as well (e.g., horde2, php4-mysql or -pgsql, et cetera), but apt will happily inform you of all this.

In fact, it's only now that we get to the part that apt doesn't just do for you, but this part is easy, too. First, there ought to be a file called /etc/horde2/apache.conf which needs to be symblinked into /etc/apache2/sites-enabled/. I'd recommend inserting a line saying simply SSLRequireSSL just after the allow from all line. This will ensure that you can't accidentally send your password to the server in cleartext.

After reloading the Apache configuration, you ought to be able to connect to https://localhost/horde2/imp/ (but not to http://&c) and get a login screen. Unfortunately, you won't be able to log in yet, because imp3 will silently fail when presented with the self-signed certificate that dpkg-configure generated for you back when you installed uw-imapd-ssl. You need to modify /etc/imp3/servers.php to include a different file, e.g., /etc/imp3/servers-debian.conf which is a copy of the automatically-generated file /var/lib/imp3/servers-debian.conf except that you need to change the value of the 'protocol' argument to 'imap/novalidate-cert'. Your other option, of course, is to convince the php4-imap-ssl module that your key is a valid signing key, but since I didn't do this, I can't exactly tell you how without working it out myself (which kind of defeats the purpose, viz., laziness, of having done it this way in the first place).

If you have an inordinate number of files under ~/mail/ (as I do), the "folders" view will probably cause the php backend to exceed its maximum memory allocation. This is controlled by the memory_limit variable in /etc/php4/apache2/php.ini; you'll know you need to do this if, after logging in, clicking the "Folders" icon does nothing.

Now comes the real hotness: MIMP. It's Imp for your WAP phone. Once I get some more time, I'm totally going to play around with this. If all goes according to plan, I'll be able to access my mail through any SSL-enabled IMAP client, any web browser, or my cell phone while retaining all my current procmail/spamassassin/&c filtering and the ability to keep using mutt locally on positron.

Hotness.


[ permalink | 2 comments ]

writebacks

jim wrote

folders
How exactly does all this work with folders? I have procmail putting my mail into somewhat arbitrary locations under ~/Mail, but I also have several hundred thousand archived messages under the same directory, stored by e-mail address. Presumably any attempts to open that will exceed just about any memory limits I can come up with.

repak wrote


Well, it doesn't load all the folders at once, it just attempts to index them and runs out of memory. It shouldn't require more than 16Mb or so to index your mail (default limit is 8Mb), but I set my limit to 24Mb just to be safe. From what I can tell of the error messages in the apache logfile, php wanted something like 10.5Mb to index my ~/mail directory.

Note that IMP has the notion of folder subscriptions (like the mailboxes directive in .muttrc). Once you get an index of all your folders, you can select your most active ones and "subscribe" to them, then have it default to only showing you ones to which you've subscribed.

-rsw




post a comment:

Save name/email/&c
Name:
URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Comments:
Key:
(Required)