Hi,

Thanks to all those working on qmailadmin - we have been using it for
about 18 months.

We have a domain with about 250 aliases and frustration at never being
able to find the one I want has eventually got the the better of me. So
here is a patch to alias.c to get the list sorted alphabetically.

I'm not a programmer by trade so I don't take any responsibility for the
code but it appears to work for me. The patch is against release 1.0.2

Cheers

Tim.

--- alias.c.orig        Thu Feb  7 18:03:46 2002
+++ alias.c     Fri Nov 29 12:07:09 2002
@@ -53,6 +53,9 @@
     char alias_name[MAX_FILE_NAME];
     char *alias_name_from_command;
     int i,j,stop,k,startnumber;
+    int m,n;
+    struct dirent **namelist;
+

     if ( AdminType!=DOMAIN_ADMIN ) {
         sprintf(StatusMessage,"%s", get_html_text("142"));
@@ -74,7 +77,10 @@
         return(0);
     }

-    while ((mydirent=readdir(mydir)) != NULL) {
+    n = scandir(".", &namelist, 0, alphasort);
+
+    for ( m=0;m<n;m++) {
+        mydirent=namelist[m];
         /*
          *  don't read files that are really ezmlm-idx listowners,
          *  i.e. .qmail-user-owner
@@ -159,9 +165,11 @@
             fclose(fs);
             k++;
         }
+    free(namelist[m]);
     }

     closedir(mydir);
+    free(namelist);

     if (AdminType == DOMAIN_ADMIN) {
         fprintf(actout, "<tr><td align=\"right\" colspan=\"4\">");



Reply via email to