Rick Macdougall asked
> >I didn't see anything in the docs or change logs specifically regarding
> >the mysql connection problem that sometimes crops up with vpopmail.  Has
> >this been addressed ?

Antonio Nati replied:
> Yes, chkuser 2.0 includes a new call, vauth_open(), that Rick Widmer told
> is in vpopmail CVS, and will be able to return the status of connection.
> As default this call is disabled, and should be enabled (uncommenting
> #define CHKUSER_ENABLE_VAUTH_OPEN in chkuser_settings.h) when this call is
> released.

Jeremy Kitchen added:
> as a suggestion, would it be possible to have a definition placed into
> vpopmail.h such as:
> that way programs that link against vpopmail can support both methods
> without any user intervention, and also this way, if say perhaps
> the postgres code doesn't have vauth_open, and the mysql does, etc,
> so someone linking against it need not worry about it :)

While the current chkuser.c might compile fine against a vpopmail
install with Sybase or Postgres, it doesn't work for MySQL because
vauth_open is defined only in vpgsql.c and vsybase.c.

To get around this, I replaced the following line in chkuser.c:

                if (vauth_open () == 0) {


        #ifdef USE_MYSQL
        #ifdef MYSQL_REPLICATION
                if (vauth_open_read () == 0) {
                if (vauth_open_update () == 0) {
                if (vauth_open () == 0) {

It seems to work fine for me.

It might make more sense for vpopmail to just create a generic
vauth_open_read function for each supported auth method so that
external modules like chkuser.c would be able to use the right
semantics without getting specific about the details.  Even in
the case of CDB (vcdb.c) the function would be defined as opening
the filehandle for reading the CDB file. ... just a thought.

Eric Ziegast

Reply via email to