int lclwakeups = 0;
int lclusefull = 0;
int rtmwakeups = 0;
int rtmusefull = 0;
int ntwwakeups = 0;
int ntwusefull = 0;
int mmcnt =0;
int babcnt =0;
int remcnt =0;
int voicnt =0;
int chacnt = 0;
int reqcnt = 0;
int defcnt =0;
int rcvcnt =0;
int bbcnt =0;
int actcnt =0;
int dmpcnt =0;
int sndcnt =0;
int sdfcnt =0;
int rtncnt =0;
int bdycnt =0;
int inqcnt =0;
int cafcnt =0;
int maicnt =0;
void do2log()
{
FILE *logfile;
char buffer[512];
int num;
if ((logfile = fopen("mail:2-mmailr.log","r")) == NULL)
{
printf("\ncould not open mail:2-mmailr.log for reading\n");
return;
}
while (!feof(logfile))
{
num = fscanf(logfile, "%*s%*s%[^\n]",buffer);
if (prefixed("DAEMON WAKEUP",buffer))
ntwwakeups++;
if (prefixed("FILE ",buffer))
ntwusefull++;
if (prefixed("PROCESSING OF RECIPIENTS DEFERRED UNTIL",buffer))
{
defcnt++;
}
if (prefixed("DONE, REQUEUED",buffer))
{
reqcnt++;
}
}
}
void do3log()
{
FILE *logfile;
char buffer[512];
int num;
if ((logfile = fopen("mail:3-mmailr.log","r")) == NULL)
{
printf("\ncould not open mail:3-mmailr.log for reading\n");
return;
}
while (!feof(logfile))
{
num = fscanf(logfile, "%*s%*s%[^\n]",buffer);
if (prefixed("DAEMON WAKEUP",buffer))
{
rtmwakeups++;
}
if (prefixed("FILE ",buffer))
{
rtmusefull++;
}
if (prefixed("PROCESSING OF RECIPIENTS DEFERRED UNTIL",buffer))
{
defcnt++;
}
if (prefixed("DONE, REQUEUED",buffer))
{
reqcnt++;
}
}
}
void outstats()
{
printf("local wakeups : %5d useful local wakeups : %5d\n",
lclwakeups,lclusefull);
printf("network wakeups : %5d useful network wakeups : %5d\n",
ntwwakeups,ntwusefull);
printf("retrans wakeups : %5d useful retrans wakeups : %5d\n",
rtmwakeups,rtmusefull);
printf("\nthere were %5d messages sent via MM\n",mmcnt);
printf("there were %5d messages sent via Babyl\n",babcnt);
printf("there were %5d messages sent via Internet SMTP\n",maicnt);
printf("there were %5d messages sent via the REMIND program\n",remcnt);
printf("there were %5d messages sent via Voice Mail\n",voicnt);
printf("there were %5d messages sent via ChaosMail\n",chacnt);
printf("there were %5d messages sent via Cafard\n",cafcnt);
printf("there were %5d messages from Dumper\n",dmpcnt);
printf("there were %5d messages from Mmailr (failed messages)\n",rtncnt);
printf("there were %5d messages from Bday Daemon\n",bdycnt);
printf("there were %5d messages from Watson\n",inqcnt);
printf("there were %5d messages from Send\n",sndcnt);
printf("there were %5d messages from Sndfil\n",sdfcnt);
printf("there were %5d messages from Accounts\n",actcnt);
printf("\n%d messages were requeued, of which %d were deferred\n",
reqcnt,defcnt);
printf("\n%d local recipients, of which %d were bboards\n",rcvcnt,bbcnt);
}