Hi Florian,

I sent this patch to Tom, (with the two closedirs() coming from him) and that seemed to fix my similar problem with creating new users and handling some fowards, both causing either segfaults during execution or before execution.  Apply this (probably varies to whatever final solution will be reached) and see if it fixes your problem.  Seems to close a couple bugs with vpalias, that I was having problems adding users and handling forwards as a result of.

Note- this is if you are not using valias, such as just using .qmail-*** files.

-M


Florian Munz <[EMAIL PROTECTED]> wrote:
Hello,

I've recently upgraded to vpopmail 5.4.14 and qmailadmin 1.2.9 (from
5.4.3 and qmailadmin 1.2.0) and everything seemed to work fine. However
for newly created domains I get a error 500 when I create a new account
or modify an account. Everything works fine for domains created before
the upgrade.

Since I've made some modifications to user.c I've removed them and tried
a clean qmailadmin and now the error is gone. But since I need these
modifications I am now trying to make it work.

One thing I noticed it that vpopmail creates new domains with a
.vpasswd.lock like this:

--w------- 1 vpopmail vchkpw 0 Feb 26 20:59 .vpasswd.lock

while the old vpopmail added the user-read privilege:

-rw------- 1 vpopmail vchkpw 0 Feb 26 20:59 .vpasswd.lock

If the vpasswd is u+rw my modifed qmailadmin works perfectly! So somehow
my modifications seem to need the user-read privilege, but I have no
idea why.

Here are my modifications:

--- user.c.orig Sun Feb 12 21:14:45 2006
+++ user.c Sun Feb 12 21:40:11 2006
@@ -48,6 +48,8 @@
#include "vpopmail.h"
#include "vauth.h"

+#define SPAM_COMMAND_FORWARD "/usr/local/etc/mailfilter-spam"
+#define SPAM_COMMAND_LOCAL "/usr/local/etc/mailfilter-inbox"

#define HOOKS 1

@@ -497,7 +499,15 @@
if(strcmp(spamvalue, "on") == 0) {
snprintf(NewBuf, sizeof(NewBuf), "%s/.qmail", mypw->pw_dir);
fs = fopen(NewBuf, "w+");
- fprintf(fs, "%s\n", SPAM_COMMAND);
+
+ fprintf(fs, "%s", SPAM_COMMAND);
+ if (mypw->pw_gid & V_USER0) {
+ fprintf(fs, " %s", SPAM_COMMAND_FORWARD);
+ } else {
+ fprintf(fs, " %s", SPAM_COMMAND_LOCAL);
+ }
+ fprintf(fs, "\n");
+
fclose(fs);
}
#endif
@@ -971,7 +981,13 @@
fprintf (fs, "# delete\n");
emptydotqmail = 0;
} else if (spam_check == 1) {
- fprintf (fs, "%s\n", SPAM_COMMAND);
+ fprintf(fs, "%s", SPAM_COMMAND);
+ if (vpw->pw_gid & V_USER0) {
+ fprintf(fs, " %s", SPAM_COMMAND_FORWARD);
+ } else {
+ fprintf(fs, " %s", SPAM_COMMAND_LOCAL);
+ }
+ fprintf(fs, "\n");
emptydotqmail = 0;
} else {
fprintf (fs, "%s/" MAILDIR "/\n", vpw->pw_dir);



So I am thinking the vpw->pw_gid and mypw->pw_gid are responsible for
the error (possbibly mypw because I wanted to use vpw there but it isn't
available)


Any help would be really appreciated
thanks,
Florian


Attachment: vpopmail.200603041811.patch.gz
Description: 1079893925-vpopmail.200603041811.patch.gz

Reply via email to