Unfortunately I don't use mysql.  I'm also not much of
a programmer in C anymore or I'd try to give a patch
for this.  But maybe my ideas will help:

Instead of just doing a readdir() in forward.c and then
comparing it to ".qmail-" before outputting it, why
not do two readdir()'s instead of one?  The first will
use the same code in forward.c:

while( (mydirent=readdir(mydir)) != NULL ) {
        if ( strncmp(".qmail-", mydirent->d_name, 7) == 0 ) {

but will just run through all the entries incrementing
a variable like entryFound++ or something, then
the loop ends.  Rewind the directory pointer with
rewinddir(mydir).  Allocate an array of the number of
entries found in size.  Run another loop almost exactly
like the existing one, adding the .qmail filenames to the
array up to the array size.  qsort() the array.  Now open
and read the files as you go through the array corresponding
to the web pages of qmailadmin.

I wish I had the skills to provide real code, sorry I
couldn't, qmailadmin becomes very hard to use with a
large number of accounts though...  otherwise it is an
extremely helpful program.

Dave 

-----Original Message-----
From: Ken Jones [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 07, 2001 4:38 PM
To: Hubbard, David
Cc: '[EMAIL PROTECTED]'
Subject: Re: Sorting forwards in qmailadmin?



qmailadmin uses the opendir command to read the .qmail files.
So what ever order opendir hands them to qmailadmin is the
order it will be displayed in. 

The new vpopmail-4.10.1 and qmailadmin-0.50 are working
towards the goal of storing forwards/aliases in a mysql
table (for mysql users). That table can be easily sorted.

Ken Jones

Reply via email to