RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 890585 - Sendmail RPM does not ship useful mailstats defaults for 10+ years
Summary: Sendmail RPM does not ship useful mailstats defaults for 10+ years
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sendmail
Version: 7.0
Hardware: All
OS: All
medium
medium
Target Milestone: rc
: 7.0
Assignee: Jaroslav Škarvada
QA Contact: Roman Žilka
URL:
Whiteboard:
Depends On:
Blocks: 1298243
TreeView+ depends on / blocked
 
Reported: 2012-12-28 00:39 UTC by Robert Scheck
Modified: 2020-09-10 09:16 UTC (History)
8 users (show)

Fixed In Version: sendmail-8.14.7-5.el7 sendmail-8.15.2-16.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 12:42:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2197 0 normal SHIPPED_LIVE sendmail bug fix and enhancement update 2017-08-01 16:09:20 UTC

Description Robert Scheck 2012-12-28 00:39:15 UTC
Description of problem:
I don't exactly know why the statistics file was relocated from originally
/etc/mail/statistics to /var/log/mail/statistics - yes, /etc/mail is not a
good place, however /var/log/mail/statistics is neither. Actually that file
is more a database containing statistics than a log file. Additionally, one
more statistics file existing since 8.12.0 (2001/09/08) is also missing by
default in Fedora/RHEL.

The mailstats command displays statistics on the volume of mail processed
by sendmail. The time at which data collection commenced is printed first, 
followed by a table with one row for each configured mailer and one showing
a summary total of all mail.

The data for the mailstats command is gathered from "O StatusFile" from the
sendmail.cf - and since 8.12.0 also from submit.cf. Right now, this looks on
Fedora like this:

/etc/mail/sendmail.cf:O StatusFile=/var/log/mail/statistics
/etc/mail/submit.cf:O StatusFile=/var/spool/clientmqueue/sm-client.st

Fedora is shipping /var/log/mail/statistics as %config(noreplace), which is
not that wrong, however /var/spool/clientmqueue/sm-client.st isn't shipped
at all. Thus mailstats only gathers data by default for the SMTP instance,
not for the MSA instance. Some could create the missing file themself, but
still the existence of the directory /var/log/mail seems wrong to me.

Suggestion to get rid this:

1. Move /var/log/mail/statistics to /var/lib/sendmail/sendmail.st
2. Create /var/lib/sendmail/sm-client.st (figure out the permissions first)
3. Do not ship %dir /var/log/mail any longer
4. Adapt SELinux policy accordingly (if needed)

Finally /var/lib/sendmail could also be a good place for dead.letter or the
other statistics tool, hoststat(1) via "O HostStatusDirectory".

The suggested new paths also align with Debian. OpenSUSE seems to be similar
strange: /var/lib/sendmail/statistics & /var/spool/clientmqueue/sm-client.st
They even ship /var/spool/mqueue/.hoststat, but nothing for the MSA instance
of Sendmail through. Debian does not configure HostStatusDirectory at all by
default. RHL 6.1 used /var/log/sendmail.st (Sendmail 8.9.x).

We eventually could think about /var/log/mail/{sendmail,sm-client}.st or
something similar, but I still don't think that the log directory is that
well here.

Version-Release number of selected component (if applicable):
sendmail-8.14.6-1

How reproducible:
Everytime, see above and below.
  
Actual results:
Sendmail RPM does not ship useful mailstats defaults for 10+ years.

Expected results:
See suggestion above. I'm also up to discussions or clarifications from the
guys who did the upgrade inside of RHL (which are less meanwhile IIRC).

Comment 1 Robert Scheck 2013-01-10 23:18:26 UTC
Cross-filed case 00775785 in the Red Hat Customer Portal to address this also
for RHEL 7 (and maybe via the paid Red Hat way also for Fedora then).

Comment 3 Ludek Smid 2014-06-26 10:44:43 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 4 Ludek Smid 2014-06-26 11:16:47 UTC
The comment above is incorrect. The correct version is bellow.
I'm sorry for any inconvenience.
---------------------------------------------------------------

This request was NOT resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you need
to escalate this bug.

Comment 7 Jaroslav Škarvada 2016-10-25 15:56:55 UTC
What do you mean by "useful"? MTA statistics are working, thus the statistics file is useful. The only file that is missing is file for MSP statistics, but as sendmail is usually used as a SMTP server in enterprise, I do not see this as a "show stopper". If needed, the MSP statistics can be still enabled by simple touch command. I think this is worth fixing and it's easy fix.

But I don't think it's a good idea to change default location of statistics files in stable enterprise release just to 'align with Debian'. Is there any other technical reason why to do so? We can change it in Fedora rawhide, but not in stable RHEL.

Comment 9 Jaroslav Škarvada 2017-03-23 16:58:39 UTC
[1] Our default for sm-client is:
/var/spool/clientmqueue/sm-client.st
and the statistics are disabled.

[2] Better default would be:
/var/log/mail/sm-client.st
to align it with the current sendmail statistics (/var/log/mail/statistics)

[3] And probably the best default is:
/var/lib/sendmail/sm-client.st
and
/var/lib/sendmail/statistics or /var/lib/sendmail/sendmail.st (it's not clear whether upstream prefers 'statistics' or 'sendmail.st')

We shouldn't change the defaults to [3] or [2] during lifetime of the product, but we could consider the change for Fedora and next RHEL.

For now just explicitly enabling the stats for mailstats program to work.

Comment 10 Jaroslav Škarvada 2017-03-23 17:06:11 UTC
(In reply to Jaroslav Škarvada from comment #9)
> [3] And probably the best default is:

The best regarding FHS and structure of other packages (i.e. probably the most clean).

Comment 12 Robert Scheck 2017-03-24 11:23:30 UTC
Jaroslav, thank you very much for taking care here. Note, the RHBZ as well
as the corresponding GSS ticket were filed 1+ years before RHEL 7 GA. Thus
the changes as mentioned are fine for RHEL 7.x from my point of view.

For Fedora Rawhide (thus next RHEL) however, I would prefer [3]. While in
the end I less care about …/sendmail.st vs. …/statistics, I personally would
prefer …/sendmail.st to make the difference between the two daemons/files a
bit more obvious. Shall I put this second paragraph into a separate RHBZ?

Comment 13 Jaroslav Škarvada 2017-03-24 12:05:10 UTC
(In reply to Robert Scheck from comment #12)
> Jaroslav, thank you very much for taking care here. Note, the RHBZ as well
> as the corresponding GSS ticket were filed 1+ years before RHEL 7 GA. Thus
> the changes as mentioned are fine for RHEL 7.x from my point of view.
> 
> For Fedora Rawhide (thus next RHEL) however, I would prefer [3]. While in
> the end I less care about …/sendmail.st vs. …/statistics, I personally would
> prefer …/sendmail.st to make the difference between the two daemons/files a
> bit more obvious. Shall I put this second paragraph into a separate RHBZ?

Please file Fedora rawhide bug.

Comment 14 Robert Scheck 2017-03-24 12:35:53 UTC
(In reply to Jaroslav Škarvada from comment #13)
> Please file Fedora rawhide bug.

Done, bug #1435639 - thank you.

Comment 15 Roman Žilka 2017-04-13 12:49:05 UTC
QA: OK on all archs

************* sendmail-8.14.7-4.el7 (faulty):

# grep StatusFile /etc/mail/*
/etc/mail/sendmail.cf:O StatusFile=/var/log/mail/statistics
/etc/mail/submit.cf:O StatusFile=/var/spool/clientmqueue/sm-client.st
# ls -l /var/log/mail/statistics /var/spool/clientmqueue/sm-client.st
ls: cannot access /var/spool/clientmqueue/sm-client.st: No such file or directory
-rw-------. 1 root root 0 Jan 27  2014 /var/log/mail/statistics

************* sendmail-8.14.7-5.el7 (fixed):

# grep StatusFile /etc/mail/*
/etc/mail/sendmail.cf:O StatusFile=/var/log/mail/statistics
/etc/mail/submit.cf:O StatusFile=/var/spool/clientmqueue/sm-client.st
# ls -l /var/log/mail/statistics /var/spool/clientmqueue/sm-client.st
-rw-------. 1 root  root  0 Mar 23 14:10 /var/log/mail/statistics
-rw-rw----. 1 smmsp smmsp 0 Apr 13 08:46 /var/spool/clientmqueue/sm-client.st

Comment 16 Fedora Update System 2017-07-27 15:10:42 UTC
sendmail-8.15.2-15.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-f4431ab4a2

Comment 17 Fedora Update System 2017-07-29 00:53:27 UTC
sendmail-8.15.2-16.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-f4431ab4a2

Comment 18 Roman Žilka 2017-07-31 07:16:15 UTC
This is a strange status transition. Still, sendmail-8.15.2-16.fc26 verified.

Comment 19 errata-xmlrpc 2017-08-01 12:42:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2197

Comment 20 Fedora Update System 2017-08-07 17:19:38 UTC
sendmail-8.15.2-16.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.