On Sun, 2006-31-12 at 08:59 +0100, Hanno Hecker wrote: > On Sun, 31 Dec 2006 01:40:47 +0100 > Joe Knall <[EMAIL PROTECTED]> wrote: <snip> > > Next question: where to initialize the connection to my database? > > I think the init-method should be the correct place, isn't it? <snip> > This one is a bit tricky and depends on what flavour of qpsmtpd you are > running. A connection fh to the database created in init() cannot be > used in -forkserver and -prefork, as the DB will be confused if > multiple queries arrive at the same fh/connection (from the DB's point > of view) at the same time. In both of these flavours the forking is > done after loading the plugins. <snip> > The best thing[tm] would be a uniform Qpsmtpd::DBI module, which > handles all flavours of qpsmtpd. I can do this for -forkserver and > -prefork, but I will need help for Apache::Qpsmtpd and -async. > > Hanno
I've started working on a dbi auth plugin but stalled due to being busy over the holiday. Also because I've been trying to understand how the plugins work. For authentication, I would assume that things are a bit simpler than a general module. Could you clarify for me: 1. I want to read the connection parameters from config/auth_dbi 2. I will make a new DBI connection for each auth request so I store the db name, user, password rather than '$dbh'. I understand how to get the config parameters but I don't have a good sense of how init() is called. Presumably when the plugin is loaded but I notice in some plugins that arguments are passed to init() while in others the configuration is read directly. 3. Are the arguments passed read from the config file or do I have to do that myself -- is init() the right place to read them if I only want to read the configuration once ? thanks, -- --gh
