On Tue, 28 Sep 2004, a.h.s. boy wrote:

> I installed vpopmail with MySQL support, without valias support (as
> seems to be recommended). I've written some PHP scripts that can create
> and modify email accounts by direct interface with MySQL, but I'm
> looking for ways to do more administration of vpopmail -- creating
> aliases, adding domains, etc.

I used to have an issue with valias but that has been fixed in newer
versions of vpopmail.

If you use valias, adding and deleting aliases is as simple as
manipulating rows in the table.

As mentioned on this list at the beginning of the month, you can
essentially add users by adding a row to the table for your users (usually
vpopmail) with an empty home directory.  When an email is first delivered
or the account is checked via POP3 or IMAP, the directory field is
populated and the directory is set up.  (Emails from this thread are also
in the README.mysql file in vpopmail 5.4.7.)

There is unfortunately no like mechanism for deleting users as far as I

Adding/deleting domains requires modifying qmail control files so these
would need to be done as root (unless you want to play ownership games
with said files).

There is work underway to create a vpopmail daemon that can parse requests
from PHP scripts or other sources and make the appropriate changes.  My
understanding is that the existing PHP vpopmail extension has been
obsoleted in favour of a new set that will use the daemon.

> Since .qmail files needs to be owned by vpopmail:vchkpw, and the v*
> applications need to run as root, I can't really have Apache/PHP try to
> accomplish any of that stuff directly. What I'm thinking right now is
> that I could write out formatted text files to a specific directory,
> then have a cron job (running as root) that parses them and executes
> various commands: vadddomain, valias, etc.

That would work.  I do something vaguely like that for deleting users
through my vpopmail admin module for squirrelmail already.  (Really what I
do is put the information for the deleted user into a separate table and
take the user out of the vpopmail table.  A perl script then handles
archiving/deleting the user data.)

Another method, advocated by some people, is to run a separate copy of
apache with the user vpopmail and group vchkpw.  I don't like this
solution at all.  (Which is why I ended up writing my own admin module.
Maybe my boss will let me distribute it.  I must remember to ask him...)
There's always suexec (and mod_phpsuexec) but I don't like that solution
much either.


Chris Ess
System Administrator / CDTT (Certified Duct Tape Technician)

Reply via email to