Update of /cvsroot/qmailadmin/qmailadmin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3044 Modified Files: Tag: stable-1_2 ChangeLog alias.c auth.c command.c qmailadmin.c qmailadmin.h template.c user.c Log Message: Add #define to qmailadmin.h for globally setting Maildir directory name (defaults to /Maildir but Gentoo can use .maildir). Index: qmailadmin.h =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/qmailadmin.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -d -r1.1.1.1 -r1.1.1.1.2.1 --- qmailadmin.h 10 Sep 2003 21:38:43 -0000 1.1.1.1 +++ qmailadmin.h 19 Oct 2004 15:44:40 -0000 1.1.1.1.2.1 @@ -16,6 +16,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ +/* Some platforms use '.maildir' instead of 'Maildir' as the mail directory + * name. Furture versions of Vpopmail might define it. Until then, change + * it below. + */ +#ifndef MAILDIR +#define MAILDIR "Maildir" +#endif #define QMAILADMIN_TEMPLATEDIR "QMAILADMIN_TEMPLATEDIR" Index: ChangeLog =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/ChangeLog,v retrieving revision 1.15.2.25 retrieving revision 1.15.2.26 diff -u -d -r1.15.2.25 -r1.15.2.26 --- ChangeLog 19 Oct 2004 15:42:36 -0000 1.15.2.25 +++ ChangeLog 19 Oct 2004 15:44:40 -0000 1.15.2.26 @@ -6,6 +6,8 @@ Tom Collins - Modify contrib/alias2forward.pl to work with '/Maildir' or '/.maildir' directory names. + - Add #define to qmailadmin.h for globally setting Maildir directory + name (defaults to "/Maildir" but Gentoo can use ".maildir"). 1.2.3 - released 7-Oct-04 Index: qmailadmin.c =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/qmailadmin.c,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -u -d -r1.6.2.1 -r1.6.2.2 --- qmailadmin.c 24 Apr 2004 01:06:40 -0000 1.6.2.1 +++ qmailadmin.c 19 Oct 2004 15:44:40 -0000 1.6.2.2 @@ -232,11 +232,11 @@ exit(0); } - sprintf(TmpBuf, "%s/Maildir", pw->pw_dir); + sprintf(TmpBuf, "%s/" MAILDIR, pw->pw_dir); del_id_files( TmpBuf); Mytime = time(NULL); - sprintf(TmpBuf, "%s/Maildir/%d.qw", pw->pw_dir, Mytime); + sprintf(TmpBuf, "%s/" MAILDIR "/%d.qw", pw->pw_dir, Mytime); fs = fopen(TmpBuf, "w"); if ( fs == NULL ) { fprintf(actout,"%s %s<br>\n", get_html_text("144"), TmpBuf); Index: alias.c =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/alias.c,v retrieving revision 1.4.2.7 retrieving revision 1.4.2.8 diff -u -d -r1.4.2.7 -r1.4.2.8 --- alias.c 26 Aug 2004 00:12:03 -0000 1.4.2.7 +++ alias.c 19 Oct 2004 15:44:40 -0000 1.4.2.8 @@ -664,11 +664,11 @@ b = NULL; /* pointer to mailbox name */ if ((s = strrchr(user, '/')) == NULL) return NULL; - if (strcmp(s, "/Maildir") != 0) { + if (strcmp(s, "/" MAILDIR) != 0) { b = s + 2; /* point to name of submailbox */ *s = '\0'; /* add NULL */ if ((s = strrchr(user, '/')) == NULL) return NULL; - if (strcmp(s, "/Maildir") != 0) return NULL; + if (strcmp(s, "/" MAILDIR) != 0) return NULL; } *s = '\0'; Index: command.c =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/command.c,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -d -r1.2.2.1 -r1.2.2.2 --- command.c 1 Oct 2004 19:45:31 -0000 1.2.2.1 +++ command.c 19 Oct 2004 15:44:40 -0000 1.2.2.2 @@ -253,7 +253,7 @@ delautorespondnow(); } else if (strcmp(TmpBuf2, "logout") == 0 ) { - sprintf(TmpBuf, "%s/%s/Maildir", RealDir, Username ); + sprintf(TmpBuf, "%s/%s/" MAILDIR, RealDir, Username ); del_id_files(TmpBuf); show_login(); Index: user.c =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/user.c,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -u -d -r1.11.2.1 -r1.11.2.2 --- user.c 12 Jun 2004 21:28:04 -0000 1.11.2.1 +++ user.c 19 Oct 2004 15:44:40 -0000 1.11.2.2 @@ -167,7 +167,7 @@ fprintf(actout, "<td align=\"left\">%s</td>", pw->pw_gecos); /* display user's quota */ - snprintf(path, sizeof(path), "%s/Maildir", pw->pw_dir); + snprintf(path, sizeof(path), "%s/" MAILDIR, pw->pw_dir); readuserquota(path, &diskquota, &maxmsg); fprintf(actout, "<td align=\"right\">%-2.2lf / </td>", ((double)diskquota)/1048576.0); /* Convert to MB */ if (strncmp(pw->pw_shell, "NOQUOTA", 2) != 0) { @@ -928,7 +928,7 @@ /* if spam check is enabled, that will save the message*/ fprintf(fs, "%s\n", SPAM_COMMAND); } else { - fprintf(fs,"%s/Maildir/\n", vpw->pw_dir); + fprintf(fs,"%s/" MAILDIR "/\n", vpw->pw_dir); } } fclose(fs); @@ -962,7 +962,7 @@ if(spam_check==1) fprintf(fs, "%s\n", SPAM_COMMAND); else - fprintf(fs,"%s/Maildir/\n", vpw->pw_dir); + fprintf(fs,"%s/" MAILDIR "/\n", vpw->pw_dir); fclose(fs); /* set up the message file */ Index: template.c =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/template.c,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -u -d -r1.7.2.2 -r1.7.2.3 --- template.c 7 Sep 2004 05:07:45 -0000 1.7.2.2 +++ template.c 19 Oct 2004 15:44:40 -0000 1.7.2.3 @@ -521,7 +521,7 @@ fprintf(actout, "<font size=\"2\" color=\"#000000\"><b>%s:</b><br>%s %s %s", get_html_text("249"), get_html_text("253"), qconvert, qnote); fprintf(actout, "<br>%s ", get_html_text("254")); - snprintf(path, sizeof(path), "%s/Maildir", vpw->pw_dir); + snprintf(path, sizeof(path), "%s/" MAILDIR, vpw->pw_dir); readuserquota(path, &diskquota, &maxmsg); fprintf(actout, "%-2.2lf MB</font><br>", ((double)diskquota)/1048576.0); /* Convert to MB */ } @@ -962,7 +962,7 @@ memset(dir, 0, sizeof(dir)); retval = ""; if ( (vpw = vauth_getpw(Username, Domain)) != NULL ) { - sprintf(dir, "%s/Maildir/%d.qw", vpw->pw_dir, Mytime); + sprintf(dir, "%s/" MAILDIR "/%d.qw", vpw->pw_dir, Mytime); fs_qw = fopen(dir, "r"); if ( fs_qw != NULL ) { memset(TmpBuf, 0, sizeof(TmpBuf)); Index: auth.c =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/auth.c,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -d -r1.3.2.1 -r1.3.2.2 --- auth.c 6 Sep 2004 17:29:23 -0000 1.3.2.1 +++ auth.c 19 Oct 2004 15:44:40 -0000 1.3.2.2 @@ -49,7 +49,7 @@ exit(0); } - sprintf(TmpBuf1, "%s/Maildir/%s.qw", pw->pw_dir, Time); + sprintf(TmpBuf1, "%s/" MAILDIR "/%s.qw", pw->pw_dir, Time); fs = fopen(TmpBuf1, "r"); if ( fs == NULL ) { @@ -103,7 +103,7 @@ exit(0); } - sprintf(TmpBuf1, "%s/Maildir/%s.qw", pw->pw_dir, Time); + sprintf(TmpBuf1, "%s/" MAILDIR "/%s.qw", pw->pw_dir, Time); fs = fopen(TmpBuf1, "r"); if ( fs == NULL ) { |