From: Tom C. <tom...@us...> - 2004-10-23 20:50:18
|
Update of /cvsroot/qmailadmin/qmailadmin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13111 Modified Files: Tag: stable-1_2 ChangeLog alias.c Log Message: Better detect .qmail-alias files that are tied to mailing lists. Index: alias.c =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/alias.c,v retrieving revision 1.4.2.8 retrieving revision 1.4.2.9 diff -u -d -r1.4.2.8 -r1.4.2.9 --- alias.c 19 Oct 2004 15:44:40 -0000 1.4.2.8 +++ alias.c 23 Oct 2004 20:49:56 -0000 1.4.2.9 @@ -20,6 +20,8 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sys/types.h> +#include <sys/stat.h> #include <unistd.h> #include <pwd.h> #include <errno.h> @@ -105,6 +107,7 @@ struct dirent **namelist; char this_alias[MAX_FILE_NAME]; char *alias_line; + struct stat sbuf; if ( AdminType!=DOMAIN_ADMIN ) { sprintf(StatusMessage,"%s", get_html_text("142")); @@ -178,22 +181,24 @@ if ( strncmp(".qmail-", mydirent->d_name, 7) == 0 ) { if ( strcmp(mydirent->d_name, ".qmail-default") == 0 ) continue; + /* check for ezmlm lists (file is symbolic link) */ + memset (&sbuf, 0, sizeof(sbuf)); + if (lstat (mydirent->d_name, &sbuf) == 0) { + if (sbuf.st_mode & S_IFLNK == S_IFLNK) continue; + } + if ( (fs=fopen(mydirent->d_name,"r"))==NULL) { fprintf(actout,"<tr><td colspan=4>"); fprintf(actout,"%s %s", get_html_text("144"), mydirent->d_name); fprintf(actout,"</td></tr>\n"); continue; } + for(i=7,j=0;j<MAX_FILE_NAME-1&&mydirent->d_name[i]!=0;++i,++j) { alias_name[j] = mydirent->d_name[i] == ':' ? '.' : mydirent->d_name[i]; } alias_name[j] = 0; - /* until there's a better solution, assume that all aliases ending - * with "-owner" are ezmlm lists and should be ignored. - */ - if (strcmp ("-owner", &alias_name[j-6]) == 0) continue; - memset(TmpBuf2, 0, sizeof(TmpBuf2)); fgets(TmpBuf2, sizeof(TmpBuf2), fs); alias_name_from_command = dotqmail_alias_command(TmpBuf2); Index: ChangeLog =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/ChangeLog,v retrieving revision 1.15.2.26 retrieving revision 1.15.2.27 diff -u -d -r1.15.2.26 -r1.15.2.27 --- ChangeLog 19 Oct 2004 15:44:40 -0000 1.15.2.26 +++ ChangeLog 23 Oct 2004 20:49:56 -0000 1.15.2.27 @@ -8,6 +8,9 @@ '/.maildir' directory names. - Add #define to qmailadmin.h for globally setting Maildir directory name (defaults to "/Maildir" but Gentoo can use ".maildir"). + - Better detect .qmail-alias files that are tied to mailing lists. + (Aliases that end in "-owner" but aren't tied to ezmlm lists + will now display properly.) 1.2.3 - released 7-Oct-04 |