If you're running the new 1.2.5 development release, please be aware that there's a bug in how it handles blank lines. It has been fixed in CVS and will go into the 1.2.6 release. Here's the patch for anyone who needs it.

--- user.c      27 Nov 2004 17:18:06 -0000      1.11.2.6
+++ user.c      7 Dec 2004 00:34:21 -0000       1.11.2.7
@@ -998,7 +998,7 @@
   static struct vqpasswd *vpw = NULL;
   static FILE *fs1=NULL; /* for the .qmail file */
   static FILE *fs2=NULL; /* for the vacation message file */
-  int i;
+  int i, j;
   char fn[500];
   char linebuf[256];
   int inheader;
@@ -1027,7 +1027,7 @@
       while (fgets (linebuf, sizeof(linebuf), fs1) != NULL) {
         i = strlen (linebuf);
         /* strip trailing newline if any */
-        if (i && linebuf[i-1] == '\n') linebuf[i-1] = '\0';
+        if (i && (linebuf[i-1] == '\n')) linebuf[i-1] = '\0';

         switch (*linebuf) {
           case '\0':   /* blank line, ignore */
@@ -1116,8 +1116,11 @@
     case '2':  /* forwarding addresses */
       if (fs1 != NULL) {
         rewind (fs1);
-        i = 0;
+        j = 0;
         while (fgets (linebuf, sizeof(linebuf), fs1) != NULL) {
+          i = strlen (linebuf);
+          /* strip trailing newline if any */
+          if (i && (linebuf[i-1] == '\n')) linebuf[i-1] = '\0';
           switch (*linebuf) {
             case '\0': /* blank line */
             case '/':  /* maildir delivery */
@@ -1127,9 +1130,9 @@
               break;

default: /* email address delivery */
- /* print address, skipping over '&' if necessary and removing newline */
- if (i++) printf (", ");
- printh ("%H", strtok(&linebuf[(*linebuf == '&' ? 1 : 0)], "\n"));
+ /* print address, skipping over '&' if necessary */
+ if (j++) printf (", ");
+ printh ("%H", &linebuf[(*linebuf == '&' ? 1 : 0)], "\n");
}
}
}



-- Tom Collins - [EMAIL PROTECTED] QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/ Info on the Sniffter hand-held Network Tester: http://sniffter.com/



Reply via email to