[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problems creating users



We add users with a form/PHP entry into database.
If the entry is "alias" and virtual_host variable is a new variable,
it
	- adds it to the locals table in the db
	- creates /usr/mail/$virtual_host directory with chmod 0770
(result drwxrwx---  3 nobody  mailusers  512 Jun  4 05:36
nexusisp.com)
	- adds the alias entry into the passwd table

*Q1: At what point in time does sqlcreatehomedir add the maildir files
for the alias user?

We then add user david...

*Q2 are the uid and gid entried for the passwd table supposed to be
uid and gid entries in /etc/passwd? or are they used internally for
database only?

...currently setting random or selected uid and gid, set password,
default the others...

Then we go to test the newly created user

nx1# /var/qmail/bin/qmail-getpw david nexusisp.com ; $?
david21/usr/mail/nexusisp.com/david00: Command not found.

It appears that it gets to the stage of trying to run sqlcreatehomedir
and runs into problems

End result is
	drwx------  2 operator  daemon  512 Jun  4 05:36 david
in the appropriate /usr/mail/$virtual_host directory
there are no maildir/qmail files in this directory.


not sure why this is failing, and would also like to clarify the
following:

1) if all new virtual_hosts that are going to be serviced locally are
entered into the locals db table, when to any actual changes need to
take place in the /etc/passwd file, or /var/qmail/control/locals file

2) Whenever we need to add users/domains to this mail server, we need
only add a alias entry in the passwd table, and a domain name in the
locals table, create a directory in our /usr/mail tree matching the
domain name for the program to dump user subdirectories for that
domain name, and its a done deal?



here are info files about the setup
-- in /etc/passwd --
alias:*:81:81:User &:/var/qmail/alias:/nonexistent
qmaill:*:83:81:User &:/var/qmail:/nonexistent
qmaild:*:82:81:User &:/var/qmail:/nonexistent
qmailp:*:84:81:User &:/var/qmail:/nonexistent
qmailq:*:85:82:User &:/var/qmail:/nonexistent
qmailr:*:86:82:User &:/var/qmail:/nonexistent
qmails:*:87:82:User &:/var/qmail:/nonexistent
vpopmail:*:89:89:User &:/usr/local/vpopmail:/nonexistent
virtual:*:1002:103:virtual:/home/mail:/nonexistent
-- in /etc/passwd --

-- in /etc/group -- # using this as the "nofiles" group
mailusers:*:103:
-- in /etc/group --

-- in /var/qmail/controls --
-rw-r--r--  1 root    qmail       27 Jun  4 03:28 defaultdomain
-rw-r--r--  1 root    qmail       73 Jun  4 03:28 locals
-rw-r--r--  1 root    qmail       73 Jun  4 02:11 locals.bak
-rw-r--r--  1 root    qmail       31 Jun  4 03:28 me
-rw-r--r--  1 root    qmail       27 Jun  4 03:28 plusdomain
-rw-r--r--  1 root    qmail       73 Jun  4 03:28 rcpthosts
-r--r-----  1 qmails  mailusers  552 Jun  4 05:36 sqlserver
-- in /var/qmail/controls --

-- in /var/qmail/controls/sqlserver --
db_use yes
check_host yes
connectionstring host=localhost user=dbuser password=secret
dbname=qmaildb
popconnectionstring host=localhost user=dbuser password=secret
dbname=qmaildb
dbtable passwd
autohomedir yes
localtable locals
virt_host_field _virtual_host
login_field _login
passwd_field _password
home_field _home
uid_field _uid
gid_field _gid
quota_field _hardquota
enabled_field _enabled
startdate_field _startdate
stopdate_field _stopdate
localpop nexusisp.com
lastlogin_field lastlogin
global_use yes
global_domain nexusinternetsolutions.net
-- in /var/qmail/controls/sqlserver --

-- in /usr/local/sbin --
-rwsr-x---  1 root  mailusers   11988 Jun  3 20:06 sqlcreatehomedir
-- in /usr/local/sbin --

-- in qmaildb / table passwd --
 cpnum | _login | _uid | _gid |            _home             |
_virtual_host | _
password | _hardquota |       _startdate       | _stopdate | _enabled
-------+--------+------+------+------------------------------+--------
-------+--
---------+------------+------------------------+-----------+----------
     1 | alias  |    1 |    1 |                              |
nexusisp.com  |
         |          0 | 2001-06-04 04:47:32-04 | infinity  | t
     1 | david  |    2 |    1 | /usr/mail/nexusisp.com/david |
nexusisp.com  | p
assword  |          0 | 2001-06-04 04:55:34-04 | infinity  | t
(2 rows)
-- in qmaildb / table passwd --

anything else?

Dave