[qmailadmin] Sorting alias entries

2002-11-29 Thread Tim Janes

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.origThu 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;mn;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, trtd align=\right\ colspan=\4\);






Re: [qmailadmin] QmailAdmin with qmail and POSIX users in LDAP?

2002-11-29 Thread Tren Blackburn
QMailadmin has a prerequisite of vpopmail.  Vpopmail makes virtual users only.  
QMailadmin does not create system users.  It only supports users created via 
vpopmail (virtual users)  Read the documentation that comes with both vpopmail 
and qmailadmin if you want to know how they work

Tren

Quoting Andrew McCall [EMAIL PROTECTED]:

 On Thursday 28 November 2002 6:04 pm, Jérôme MOLLIER-PIERRET 
 wrote:
  You probably missed something, if you need an LDAP
  implementation try the qmailldap patch (most contribs are
  mentioned in
  http://www.qmail.org) ... but you couldn't have qmailadmin
  working with it (try phpQLAdmin instead ...). You can use
  vpopmail with qmailadmin, and LDAP but ... only for
  authentification.
 
  Another important point is that Exchange has calendar
  fonctionnalities ... this could not be implemented in the same
  way (MAPI + Outlook). If i'm wrong, or if anybody has more
  information ...
 
 Yes you can do *exactly* that - using the Bynari InsightConnector 
 Plug in.
 
  Please use a engine like google, spend more time seeking
  information. Open-source isn't free consulting...
 
 Please spend more time reading my question before flaming me.
 
 I wasn't seeking consulting - I was seeking information on how 
 exactly QmailAdmin works, i.e. does it create *real* system 
 users, which seems to be a requirement due to the shared folders 
 and ACL's needed.
 
 
 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.
 
 This footnote also confirms that this email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 
 www.oldham.gov.uk
 **
 
 

 


--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- Tren Blackburn - Ownermailto:[EMAIL PROTECTED]  =
= EOT Networks   http://www.eotnetworks.com  -
- Phone (403) 818-7658   Fax (403) 269-2122  =
= ** Infinite Solutions for a Finite World **-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--

DISCLAIMER:  This e-mail message is intended only for the named 
recipient(s) above and may contain information that is privileged, 
confidential and/or exempt from disclosure under applicable law. If you 
have received this message in error, or are not the named recipient(s), 
please immediately notify the sender and delete this e-mail message.



This message sent via EOT-Mail: http://www.eot-mail.com/




[qmailadmin] A collection of patches for qmailadmin-1.0.6

2002-11-29 Thread Michael Bowe
Hello

Please find attached four patches for qmailadmin-1.0.6 that fix an assortment of bugs 
and cosmetic issues.
There are comments in the top bit of each of the patches that include a more detailed 
description of why they are needed.

qmailadmin-1.0.6-forwardalias-nextpage.patch.txt
  Fix the bug in the forwards/aliases screen where the nextpage hyperlink
  is shown even when there are no more users to display 

qmailadmin-1.0.6-configure-maxaliasesperpage.patch.txt
  Fix the typo in the configure script regarding the maxaliasesperpage option

patch  qmailadmin-1.0.6-forwardalias-sorted.patch.txt
  Enable sorting of the userlist on the forwards/aliases screen
  (Same as patch for qmailadmin-1.0.2 as posted to this list the 
  other day by Tim Janes)

qmailadmin-1.0.6-userlist-sorted.patch.txt
  Enable alphabetical sorting of the email accounts screens and also
  the userlist dropdownboxes for people using a vpopmail backend 
  other than cdb (eg MySQL)


Michael.

###
#
# In qmailadmin-1.0.6, the page navigation hyperlinks at the bottom
# of the show forwards/aliases screen alway display next page
# even when there are no more users to display
#
# By Michael Bowe [EMAIL PROTECTED]
#
###

--- alias.c.origSat Nov 30 12:56:39 2002
+++ alias.c Sat Nov 30 13:00:56 2002
@@ -46,6 +46,7 @@
 
 show_dotqmail_lines(char *user, char *dom, time_t mytime, char *dir)
 {
+ int moreusers=0;
  DIR *mydir;
  struct dirent *mydirent;
  FILE *fs;
@@ -89,6 +90,7 @@
 continue;
   }
   if ( k MAXALIASESPERPAGE + startnumber) {
+moreusers=1;
 break;
   }
 
@@ -174,9 +176,11 @@
 fprintf(actout, a 
href=\%s/com/showforwards?user=%sdom=%stime=%dpage=%s\%s/a,
   CGIPATH,user,dom,mytime,Pagenumber,get_html_text(136));
 fprintf(actout, nbsp;|nbsp;);
-fprintf(actout, a 
href=\%s/com/showforwards?user=%sdom=%stime=%dpage=%d\%s/a,
-  CGIPATH,user,dom,mytime,atoi(Pagenumber)+1,get_html_text(137));
-fprintf(actout, nbsp;]);
+if (moreusers) {
+  fprintf(actout, a 
+href=\%s/com/showforwards?user=%sdom=%stime=%dpage=%d\%s/a,
+CGIPATH,user,dom,mytime,atoi(Pagenumber)+1,get_html_text(137));
+  fprintf(actout, nbsp;]);
+}
 fprintf(actout, /td/tr);
   }
 }

###
#
# The configure script for qmailadmin-1.0.6 contains a typo for the 
# maxaliasesperpage configure command 
#
# By Michael Bowe  [EMAIL PROTECTED]
#
###

--- configure.orig  Sat Nov 30 12:02:49 2002
+++ configure   Sat Nov 30 12:02:54 2002
@@ -1778,7 +1778,7 @@
 # Check whether --enable-maxaliasesperpage or --disable-maxaliasesperpage was given.
 if test ${enable_maxaliasesperpage+set} = set; then
   enableval=$enable_maxaliasesperpage
-  maxusersperpage=$enableval
+  maxaliasesperpage=$enableval
 fi
 
 cat  confdefs.h EOF

###
#
# Adjust qmailadmin-1.0.6 so that the entries on the 
# forwards/aliases screen are shown in alphabetical order
#
# Written for qmailadmin-1.0.2 by Tim Janes [EMAIL PROTECTED]
# and applied to qmailadmin-1.0.6 by Michael Bowe [EMAIL PROTECTED]
#
###
 
--- alias.c.origWed Aug  7 08:04:59 2002
+++ alias.c Sat Nov 30 11:35:24 2002
@@ -53,6 +53,8 @@
  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 +76,10 @@
 return(0);
   }
 
-  while ((mydirent=readdir(mydir)) != NULL) {
+  n = scandir(., namelist, 0, alphasort);
+  
+  for (m=0; mn; m++) {
+mydirent=namelist[m];
 /*
  *  don't read files that are really ezmlm-idx listowners,
  *  i.e. .qmail-user-owner
@@ -159,9 +164,11 @@
   fclose(fs);
   k++;
 }
+free(namelist[m]);
   }
 
   closedir(mydir);
+  free(namelist);
 
   if (AdminType == DOMAIN_ADMIN) {
 fprintf(actout, trtd align=\right\ colspan=\4\);

###
#
# According to the docs on the inter7.com web site,
# ( http://inter7.com/vpopmail/vpopmail.html )
# if you REQUIRE a vauth_getall() userlist sorted in alphabetical 
# order, you need to set the sort_it parameter to 1
# 
#   struct *vauth_getall( char *domain, int first, int sort_it )
#  domain  = domain name to retrieve password structure from
#authentication system
#  first   = 1 to get first record, 0 = get next record 
#  sort_it = 1 to have the user list sorted alphabetically.
#This has no effect on vpasswd/cdb method,
#since all