diff options
Diffstat (limited to 'gnu/usr.sbin/sendmail/mailstats/mailstats.c')
-rw-r--r-- | gnu/usr.sbin/sendmail/mailstats/mailstats.c | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/gnu/usr.sbin/sendmail/mailstats/mailstats.c b/gnu/usr.sbin/sendmail/mailstats/mailstats.c index 52a98b980ae..3d07d02eab0 100644 --- a/gnu/usr.sbin/sendmail/mailstats/mailstats.c +++ b/gnu/usr.sbin/sendmail/mailstats/mailstats.c @@ -20,7 +20,7 @@ SM_IDSTR(copyright, Copyright (c) 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Sendmail: mailstats.c,v 8.91 2001/09/11 04:05:02 gshapiro Exp $") +SM_IDSTR(id, "@(#)$Sendmail: mailstats.c,v 8.95 2001/12/30 04:59:40 gshapiro Exp $") #include <unistd.h> #include <stddef.h> @@ -34,6 +34,7 @@ SM_IDSTR(id, "@(#)$Sendmail: mailstats.c,v 8.91 2001/09/11 04:05:02 gshapiro Exp #include <sysexits.h> #include <sm/errstring.h> +#include <sm/limits.h> #include <sendmail/sendmail.h> #include <sendmail/mailstats.h> #include <sendmail/pathnames.h> @@ -58,6 +59,9 @@ main(argc, argv) bool trunc; long frmsgs = 0, frbytes = 0, tomsgs = 0, tobytes = 0, rejmsgs = 0; long dismsgs = 0; +#if _FFR_QUARANTINE + long quarmsgs = 0; +#endif /* _FFR_QUARANTINE */ time_t now; char mtable[MAXMAILERS][MNAMELEN + 1]; char sfilebuf[MAXLINE]; @@ -279,12 +283,19 @@ main(argc, argv) "Statistics from %s", ctime(&stats.stat_itime)); (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, - " M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis%s\n", + " M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis"); +#if _FFR_QUARANTINE + (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, " msgsqur"); +#endif /* _FFR_QUARANTINE */ + (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "%s\n", mnames ? " Mailer" : ""); } for (i = 0; i < MAXMAILERS; i++) { if (stats.stat_nf[i] || stats.stat_nt[i] || +#if _FFR_QUARANTINE + stats.stat_nq[i] || +#endif /* _FFR_QUARANTINE */ stats.stat_nr[i] || stats.stat_nd[i]) { char *format; @@ -301,6 +312,10 @@ main(argc, argv) stats.stat_bt[i], stats.stat_nr[i], stats.stat_nd[i]); +#if _FFR_QUARANTINE + (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, + " %6ld", stats.stat_nq[i]); +#endif /* _FFR_QUARANTINE */ if (mnames) (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, " %s", @@ -312,14 +327,22 @@ main(argc, argv) tobytes += stats.stat_bt[i]; rejmsgs += stats.stat_nr[i]; dismsgs += stats.stat_nd[i]; +#if _FFR_QUARANTINE + quarmsgs += stats.stat_nq[i]; +#endif /* _FFR_QUARANTINE */ } } if (progmode) { (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, - " T %8ld %10ld %8ld %10ld %6ld %6ld\n", + " T %8ld %10ld %8ld %10ld %6ld %6ld", frmsgs, frbytes, tomsgs, tobytes, rejmsgs, dismsgs); +#if _FFR_QUARANTINE + (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, + " %6ld", quarmsgs); +#endif /* _FFR_QUARANTINE */ + (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "\n"); (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, " C %8ld %8ld %6ld\n", stats.stat_cf, stats.stat_ct, @@ -335,11 +358,20 @@ main(argc, argv) else { (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, - "=============================================================\n"); + "============================================================="); +#if _FFR_QUARANTINE + (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "========"); +#endif /* _FFR_QUARANTINE */ + (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "\n"); (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, - " T %8ld %10ldK %8ld %10ldK %6ld %6ld\n", + " T %8ld %10ldK %8ld %10ldK %6ld %6ld", frmsgs, frbytes, tomsgs, tobytes, rejmsgs, dismsgs); +#if _FFR_QUARANTINE + (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, + " %6ld", quarmsgs); +#endif /* _FFR_QUARANTINE */ + (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "\n"); (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, " C %8ld %10s %8ld %10s %6ld\n", stats.stat_cf, "", stats.stat_ct, "", |