[Vmail-discuss] Courier IMAP anyone?

Jose de Paula Eufrasio Junior jjunior@pib.com.br
21 Jan 2003 08:25:24 -0200

On Mon, 2003-01-20 at 19:43, Chris Lightfoot wrote:
> On Mon, Jan 20, 2003 at 01:44:32PM -0800, William X Walsh wrote:
> > On Mon, 2003-01-20 at 13:35, Chris Lightfoot wrote:
> > > On Mon, Jan 20, 2003 at 01:18:43PM -0800, William X Walsh wrote:
> > > > 
> > > > Has anyone either made changes to their vmail-sql configs to conform to
> > > > Courier's expectations, or modified Courier IMAP to conform to the
> > > > vmail-sql setup?

I did...

> > > 
> > > My intention is to write an IMAP server -- provisionally,
> > > timapd -- which will implement the various authentication
> > > schemes of tpop3d and remedy some deficiencies I perceive
> > > in current IMAP implementations.
> > > 
> > > This project is at the `thinking very hard about it'
> > > stage, and has not quite reached the `writing some code'
> > > stage yet.
> > 
> > As a fan of your tpop3d, I'd most likely switch to that when it was
> > ready to use....but I need a solution in the interim, and I'm sure I'm
> > not alone  :)

Yeah! A imapd using the same scheme that tpop3d will be great! tpop3d is
light, powerfull and works with almost anything :)
I hope that you start the project as soon as you get the time (and
interest). tpop3d and exim are the most proeminent virtual email setup
in the recent times, and sure an imap server would be great.

In meanwhile, the current courier-imap (courier-imap-1.6.1) can get the
login and home data from a mysql query, so i did it get the data from my
vmail-sql tables with little modifications (in the popbox table I added
the fields imap_quota and clearpw, that I let blank anyway, and in the
domain table I put the uid and gid fields with the uid and gid for the
unix user of the domain).

Build the courier-imapd with support for authdaemon and the authmysql
module and edit the /courier-path/etc/authmysqlrc.

One of the last statements is "mysql_select_clause", here the one I use
(and works, the documentation and the comments of the config file are
rather sparse about the order of the fields and I have to figure it on
my own looking at the code):

MYSQL_SELECT_CLAUSE     SELECT popbox.local_part,                      
                        TRIM('{crypt}' FROM popbox.password_hash),     
                        TRIM(TRAILING 'Maildir' FROM CONCAT(domain.path,
'/', popbox.mbox_name)),\
                        CONCAT(domain.path, '/', popbox.mbox_name),    
                        ''                                      \
                        FROM popbox, domain                            
                        WHERE popbox.local_part = '$(local_part)'      
                        AND popbox.domain_name = '$(domain)'           
                        AND popbox.domain_name = domain.domain_name

It's not pretty and I'm sure that it can be optimized, but it works here