Hanno.  Thanks.  This is everything I needed to know.

I will write this up for the wiki ... unless someone already has
(where?).  I am still going to try to do some work on the test framework
but that really depends on what the intent is there for which I will
need to ask Ask, I guess.

I have a couple more questions below.

On Sun, 2006-31-12 at 14:01 +0100, Hanno Hecker wrote:
> >  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'.
> This will be ok for stuff which is requested just once or twice. For
> reading config values from a DB (and auth data ;-)) connecting,
> querying and disconnecting for each request is too much. 

No.  I don't want to read config values from the DB.  Just the user
password.  I think it is best to NOT cache the db handle for this
purpose.  In fact, it is probably better to maintain a connection pool
somewhere ... would that be Qpsmtpd::DBI ?

> 
> > 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
> Yes, plugin is loaded, then init() is called.
> 
> > I notice in some plugins that arguments are passed to init() while
> in
> > others the configuration is read directly.
> The arguments passed to init() are the values from the plugin line in
> config/plugins. See plugins/spamassassin for one example.

I already read this somewhere, I think, but I forgot.

> 
> >  3. Are the arguments passed read from the config file or do I have
> to
> No, see above.

But, I think init() is called only once, so I could also have a config
file for the database parameters and read them in init(), right ?

-- 
--gh


Reply via email to