Project

General

Profile

Actions

Bug #2231

open

sendmail /etc/mail/statistics ignored : #O StatusFile

Added by Richard PALO over 9 years ago. Updated over 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2012-03-04
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Thought while trying to get sendmail firmed up that statistics would be nice.

From the docs, notably /etc/mail/cf/README, the default is

STATUS_FILE        [/etc/mail/statistics] The file containing status
            information.

after touching this file and restarting sendmail, mailstats should work:
# ls -la /etc/mail/statistics 
-rw-r--r--   1 root     root           0 mars  4 11:06 /etc/mail/statistics
# mailstats
mailstats: no statistics file located
# grep StatusFile /etc/mail/sendmail.cf
#O StatusFile

is something missing from the build procedure?

I presume as a workaround I can explicitly declare the file in my sendmail.mc, but I should have too... the statistics file creation by 'touch' should be enough.

Any confirmation?


btw, a secondary nit, I notice that the manpage for sendmail still references the apparently deprecated filename 'sendmail.st'

     StatusFile (Sfile)

         Logs statistics in the named file. By default,  this  is
         /etc/mail/sendmail.st.  As  root, you must touch(1) this
         file to enable mailstats(1).

Actions #1

Updated by Richard PALO over 9 years ago

workaround is to add

define(`STATUS_FILE',`/etc/mail/statistics')dnl

to the sendmail.mc file
do make and copy sendmail.cf to /etc/mail which now contains

/etc/mail/cf/cf# make
test ! -f sendmail.cf || /usr/bin/mv sendmail.cf sendmail.cf.prev
/usr/ccs/bin/m4 ../m4/cf.m4 sendmail.mc > sendmail.cf
/etc/mail/cf/cf# grep StatusFile sendmail.cf
O StatusFile=/etc/mail/statistics
/etc/mail/cf/cf# cp sendmail.cf ../../sendmail.cf 
/etc/mail/cf/cf# svcadm restart sendmail
/etc/mail/cf/cf# mailstats
Statistics from Sun Mar  4 16:14:38 2012
 M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer
=====================================================================
 T        0          0K        0          0K        0       0       0
 C        0                    0                    0

Actions #2

Updated by Gary Mills over 9 years ago

I assume that /etc/mail/statistics is actually being updated.
The problem is that `mailstats' doesn't know about it. This
is because it reads /etc/mail/sendmail.cf by default to find
that file. If there's a bug, it's with /usr/bin/mailstats .

Actions #3

Updated by Richard PALO over 9 years ago

I don't believe so.

Just tried rolling back as before.

mailstats will work with : mailstats -f /etc/mail/statistics

but displays 0 regardless of the number of mails transmitted.

Put the workaround back in and restarted,
mailx (naturally) works without -f, but now the counters seem to correspond to the number of messages exchanged.

fwiw

Actions

Also available in: Atom PDF