qmailadmin has problems with ezmlm-idx 7.0.2: Patch

Sirko Zidlewitz <[email protected]>
Newsgroups gmane.mail.qmail.admin
Organization bytecamp GmbH
Message-ID <[email protected]>
My Collegue Robert Schulze <[email protected]> has written a patch
for mailinglist.c, but it is for qmailadmin 1.2.15.
It works for us. Thanks Rob.



--- mailinglist.c.orig	2011-08-17 15:53:26.000000000 +0200
+++ mailinglist.c	2011-08-17 15:53:32.000000000 +0200
@@ -665,6 +665,7 @@
  int handles[2],pid,z = 0,subuser_count = 0;   char buf[256];
  char *addr;
+ char dbuf[10]={0};
    if ( AdminType!=DOMAIN_ADMIN ) {
     snprintf (StatusMessage, sizeof(StatusMessage), "%s",
html_text[142]);
@@ -680,14 +681,21 @@
     close(handles[0]);
     dup2(handles[1],fileno(stdout));
     sprintf(TmpBuf1, "%s/ezmlm-list", EZMLMDIR);
+
     if(mod == 1) {
-        sprintf(TmpBuf2, "%s/%s/mod", RealDir, ActionUser);
+	sprintf(dbuf,"mod");
     } else if(mod == 2) {
-        sprintf(TmpBuf2, "%s/%s/digest", RealDir, ActionUser);
-    } else {
-        sprintf(TmpBuf2, "%s/%s/", RealDir, ActionUser);
+	sprintf(dbuf,"digest");
+    }
+
+    sprintf(TmpBuf2, "%s/%s/", RealDir, ActionUser);
+
+    if(dbuf) {
+	execl(TmpBuf1, "ezmlm-list", TmpBuf2, dbuf, NULL);
+    }
+    else {
+    	execl(TmpBuf1, "ezmlm-list", TmpBuf2, NULL);
     }
-    execl(TmpBuf1, "ezmlm-list", TmpBuf2, NULL);
     exit(127);
   } else {
     close(handles[1]);
@@ -799,9 +807,16 @@
   pid=fork();
   if (pid==0) {
     snprintf(subpath, sizeof(subpath), "%s/ezmlm-sub", EZMLMDIR);
-    snprintf(listpath, sizeof(listpath), "%s/%s/%s",
-      RealDir, ActionUser, dir);
-    execl(subpath, "ezmlm-sub", listpath, email, NULL);
+    snprintf(listpath, sizeof(listpath), "%s/%s/",
+      RealDir, ActionUser);
+
+    if(strcmp(dir,"")==0) {
+        execl(subpath, "ezmlm-sub", listpath, email, NULL);
+    }
+    else {
+        execl(subpath, "ezmlm-sub", listpath, dir, email, NULL);
+    }
+
     exit(127);
   } else wait(&pid);
 @@ -870,6 +885,7 @@
 {
  int pid;
  char *p;
+ char dbuf[10]={0};
    if ( AdminType!=DOMAIN_ADMIN ) {
     snprintf (StatusMessage, sizeof(StatusMessage), "%s",
html_text[142]);
@@ -889,13 +905,18 @@
   if (pid==0) {
     sprintf(TmpBuf1, "%s/ezmlm-unsub", EZMLMDIR);
     if(mod == 1) {
-        sprintf(TmpBuf2, "%s/%s/mod", RealDir, ActionUser);
+	sprintf(dbuf,"mod");
     } else if(mod == 2 ) {
-        sprintf(TmpBuf2, "%s/%s/digest", RealDir, ActionUser);
-    } else {
-        sprintf(TmpBuf2, "%s/%s/", RealDir, ActionUser);
+	sprintf(dbuf,"digest");
+    }
+
+    sprintf(TmpBuf2, "%s/%s/", RealDir, ActionUser);
+    if(!dbuf) {
+       execl(TmpBuf1, "ezmlm-unsub", TmpBuf2, Newu, NULL);
+    }
+    else {
+       execl(TmpBuf1, "ezmlm-unsub", TmpBuf2, dbuf, Newu, NULL);
     }
-    execl(TmpBuf1, "ezmlm-unsub", TmpBuf2, Newu, NULL);
     exit(127);
   } else wait(&pid);


!DSPAM:4e4bc8ec32711531911261!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.