Brian Kolaci wrote:

Brain, I'm on the list.  There's no need to send me a copy and the list.
Just reply to the list please.  I get enough mail as is, I don't need two
copies of the same message :)

>   > Rick Romero wrote:
>   > > IMHO, manually inserting records into MySQL is a bit of a
>   kludge.  It > > would probably be better to create a flat file of
>   users / passwords, > > and let perl loop through that and pass the
>   data to vadduser. >
>   > Ok Rick, let me get this straight -- you think doing a single
>   insert into > the MySQL database to add a user (which makes the
>   user active *NOW*) is a > kluge, but writing the info out to a flat
>   file and periodically have a perl > program loop through it and
>   call vadduser isn't?  Personally, I think it's > the other way
>   around.  Inserting them into the MySQL database directly is > clean
>   and elegant, and activates the user immedetily.  Your flat file and
>   > perl method is at *best* run every minute (the min. interval of
>   cron), > possibly longer.  You have to worry about file locking
>   (don't want to copy > the file out from under a current processes
>   that's writting to it), and > you've got a plain text file sitting
>   around with passwords in them.  I > really think you got it
>   backwards :) > > > Rick
>   >
>   > Dave
>   >
>   >
>
> I will have to agree with Rick.
>
> Not using the supplied API is a kludge.

I disagree with you.  I don't think it's a kludge, especially when support
for just such a thing was added way back in 4.9.4.  From the ChangeLog:

4.9.4
Sep 22 - modify safestring.c sstrncmp to return correct value if
         comparing a subset of two longer strings

       - vchkpw will autocreate a user directory if thier path value
         in the authentication structure is empty

Or better yet, this entry from the ChangeLog for 4.9.3:

4.9.3

Sep 18 - fix up vclose is_open login in vmysql.c vsybase.c voracle.c

       - vdelivermail will auto create a users directory if thier
         directory value in thier authentication structure is blank.
         This can be used by sql based systems, or ldap systems.
         Users can be created and inserted into the database, and
         if their path value is left blank, vpopmail will use the
         bigdir directory layout algorythm to create a directory
         and update the authentication database. So, users can be
         created by just adding them to the database and leaving
         thier directory path blank.

I'm sorry, inserting users directly into MySQL isn't a kludge in my book :)

> The correct method would be to call the C API.

There is no one true way :)

> I believe Rick was just offering one possible solution to
> using the API, however you can either use supplied programs
> or the C function calls, your choice.
>

Or you can use the auto creation features that were adding in 4.9.3 for just
such a thing, which is what the original poster was doing.  The problem is
that qmailadmin isn't using the API, and calling the auto creation routines
when a user tries to log in and the directory is blank in the authentication
database.

> Thanks,
>
>
> Brian

Dave


Reply via email to