[imp] Taking best advantage of SQL backend for an IMAP server
Kent Martin
horde at kentsworld.com
Sat Dec 4 18:04:25 PST 2004
I was just having a bit of a think, which is always a bad sign, and have
come up with what I think is a pretty good idea, bear with me here, a
little preamble before I get to the point:
My setup - courier-imap with a mysql backend
Now, quite a while back, I little suggestion for getting pine to work
with maildir style mail stores.
Essentially, it takes advantage of the "remote mailbox via ssh" feature
of pine - this feature actually has nothing to do with ssh, it is simply
a config option to gets pine to talk to stdio of a command and treat
that as the IMAP session, enter the following script:
$ cat /usr/bin/courier-imap-noerr
#!/bin/sh
umask 0077
cd $HOME && /usr/sbin/courier-imapd .maildir 2> /dev/null
So far so good - now we have an IMAP session on stdio
(incidentally, the pine config for this is
ssh-path=/usr/bin/courier-imap-noerr)
So - to put this all in a horde/imp perspective, I should be able to do
the following:
Have horde auth against the sql database (the password is stored in
there as well obviously), then, rewrite the above script to be something
like
$ cat /usr/bin/courier-imap-session
#!/bin/sh
umaske 0077
cd $1 && /usr/sbin/courier-imapd .maildir 2> /dev/null
now, as the mailstor dir is available in mysql as well, I should be able
to somehow get IMP to invoke
/usr/bin/courier-imap-session $mailstore_dir
and talk to the stdio of that instead of an IMAP session
That'd cut down a fair bit of IMAP overhead and should be faster than
imap-proxy :)
Has anybody tried something like this?
How much hacking of imp would need to take place, is there just some
"server" driver I would need to write somewhere, or would I need to get
a bit more intimate with the code than that? There'd also be some
trivial permissions issues to overcome in my case, and probably most
cases, but that'd take all of 5 mins. Obviously this is only a sensible
option when the machine upon which your webserver runs has filesystem
access to your mailstore.
Thoughts?
Cheers,
Kent.
More information about the imp
mailing list