Greetings,
I posted a question the other day and haven't had any response at all.
Error relates to creating domains, and getting error "Create Domain:
open .qmailadmin-limits failed".
I've since started trying to understand the source. I'm not much of a C
person, but it looks to me like the domain gets created before the
error, so maybe I could just comment out the section that's giving me
the error?
This is part of /usr/ports/mail/vqadmin/work/vqadmin-2.3.5/domain.c
This little section precedes the section with the error.
-----------------------------------------------
/* add the domain with defaults */
ret = vadddomain(domain, VPOPMAILDIR, VPOPMAILUID, VPOPMAILGID );
if (ret != VA_SUCCESS) {
global_warning(verror(ret));
t_open(T_MAIN, 1);
} else {
global_warning("Created Domain");
}
-----------------------------------------------
So it looks like the domain has been added ok.
Then this bit follows, with the error.
-----------------------------------------------
/* setup the .qmailadmin-limits file */
vget_assign(domain,dir,156,&uid,&gid);
strncat(dir,"/.qmailadmin-limits", 156);
if ( (fs = fopen(dir,"w+")) == NULL ) {
global_warning("Create Domain: open .qmailadmin-limits failed");
t_open(T_MAIN, 1);
}
-----------------------------------------------
Looks like it's just trying to open a file, in append mode if it's
already there. So I'm not sure why it would fail this.
The /usr/local/vpopmail/domains dir permissions look ok.
-----------------------------------------------
qmail# cd /home/vpopmail/domains/
qmail# ll
total 12
-rw------- 1 vpopmail vchkpw 34 Jun 19 16:00 .dir-control
drwx------ 2 vpopmail vchkpw 4096 Jun 23 16:23 test.com.au
-----------------------------------------------
I discovered that perhaps the vqadmin.cgi is the wrong user.
-----------------------------------------------
qmail# pwd
/usr/local/www/cgi-bin.default/vqadmin
qmail# ll
total 82
-rw-r--r-- 1 nobody vchkpw 113 May 28 16:49 .htaccess
-rw-r--r-- 1 root vchkpw 113 May 28 16:49 .htaccess.backup
drwxr-xr-x 2 vpopmail vchkpw 1024 Jun 23 16:23 html
-rw-r--r-- 1 vpopmail vchkpw 882 May 28 16:49 vqadmin.acl
-rw-r--r-- 1 vpopmail vchkpw 882 May 28 14:56 vqadmin.acl.backup
-rwsr-sr-x 1 root wheel 73220 Jun 23 16:23 vqadmin.cgi
-----------------------------------------------
so I changed that...
-----------------------------------------------
qmail# chown vpopmail:vchkpw vqadmin.cgi
qmail# ll
total 82
-rw-r--r-- 1 nobody vchkpw 113 May 28 16:49 .htaccess
-rw-r--r-- 1 root vchkpw 113 May 28 16:49 .htaccess.backup
drwxr-xr-x 2 vpopmail vchkpw 1024 Jun 23 16:23 html
-rw-r--r-- 1 vpopmail vchkpw 882 May 28 16:49 vqadmin.acl
-rw-r--r-- 1 vpopmail vchkpw 882 May 28 14:56 vqadmin.acl.backup
-rwsr-sr-x 1 vpopmail vchkpw 73220 Jun 23 16:23 vqadmin.cgi
-----------------------------------------------
And now things are even worse. Still getting the same error, plus a
bunch more errors.
-----------------------------------------------
could not open lock file /var/qmail/users/assign.lock could not open
lock file /var/qmail/control/rcpthosts.lock could not open lock file
/var/qmail/control/virtualdomains.lock could not open lock file
/var/qmail/control/locals.lock
Created Domain
Create Domain: open .qmailadmin-limits failed
-----------------------------------------------
Clearly the CGI needs to run as root to get permissions to play with
/var/qmail stuff.
So what should I do? Should I try commenting out the whole section that
creates this file?
------------------------------------------------
/* setup the .qmailadmin-limits file */
vget_assign(domain,dir,156,&uid,&gid);
strncat(dir,"/.qmailadmin-limits", 156);
if ( (fs = fopen(dir,"w+")) == NULL ) {
global_warning("Create Domain: open .qmailadmin-limits failed");
t_open(T_MAIN, 1);
}
if (lusers!=NULL&&strlen(lusers)>0)
fprintf(fs, "maxpopaccounts: %s\n", lusers);
if (lalias!=NULL&&strlen(lalias)>0)
fprintf(fs, "maxaliases: %s\n", lalias);
if (lfor!=NULL&&strlen(lfor)>0)
fprintf(fs, "maxforwards: %s\n", lfor);
if (lresponder!=NULL&&strlen(lresponder)>0)
fprintf(fs, "maxautoresponders: %s\n", lresponder);
if (llists!=NULL&&strlen(llists)>0)
fprintf(fs, "maxmailinglists: %s\n", llists);
if (quota!=NULL && strlen(quota)>0)
fprintf(fs,"default_quota: %s\n",quota);
if (upop!=NULL) fprintf(fs, "disable_pop\n");
if (uimap!=NULL) fprintf(fs, "disable_imap\n");
if (udialup!=NULL) fprintf(fs, "disable_dialup\n");
if (upassc!=NULL) fprintf(fs, "disable_password_changing\n");
if (uweb!=NULL) fprintf(fs, "disable_webmail\n");
if (urelay!=NULL) fprintf(fs, "disable_external_relay\n");
fclose(fs);
------------------------------------------
thanks,
Dave