Path: utzoo!attcan!uunet!pyrdc!pyrnj!bartal!monymsys!sonyd1.Broadcast.Sony.COM!sonyd1.Broadcast.Sony.COM!bruce From: bruce@sonyd1.Broadcast.Sony.COM (Bruce Lilly) Newsgroups: comp.mail.sendmail Subject: errors in sendmail statistics Keywords: bug Message-ID: <1990Sep18.160406.15856@sonyd1.Broadcast.Sony.COM> Date: 18 Sep 90 16:04:06 GMT Sender: bruce@sonyd1.Broadcast.Sony.COM (Bruce Lilly) Organization: Sony Communications Products Company, Teaneck, NJ Lines: 33 I've noticed two problems regarding the statistics on mailer use/message size as stored in sendmail.st by sendmail, and reported by mailstats. The following changes were made to sendmail 5.64 with IDA enhancements, but I believe they apply to vanilla 5.64 (and probably earlier versions) also. 1) The size, reported in increments of approximately 1Kbyte, is excessive. A one byte message would be reported as 1K. A solution to this is to change the #define of KBYTES(x) in stats.c to: #define KBYTES(x) (((x) + (ONE_K / 2)) / ONE_K) This is not an ideal solution, but assuming message sizes are randomly distributed, it should be more accurate than the unmodified sources. (Note that in this case, small messages are not counted at all.) 2) If the default delivery mode is b(ackground), the msgsfr count is incorrect (messages are counted twice). The cause is that the Stat structure (stats.c) is updated by a call from main() to markstats(), then written to the statistics file both in main() (poststats() called by finis()) *and* in the process forked for delivery in sendall() (which also calls finis()). The solution is to move the call (in main() in main.c) of markstats() to after the call of sendall() (near the end of main()). Consequently, the nf element of the Stat structure is not set in the version written by the forked process (it is still written by the original process). -- Bruce Lilly, Product Manager, | bruce@sonyd1.Broadcast.Sony.COM Digital Television Tape Recording, | uunet!{sonyusa,vmp}!sonyd1!bruce Sony Communications Products Co., | lilb@sony.compuserve.com (slow) Teaneck, NJ 07666 | Telephone: 1(201)833-5693 | FAX: 1(201)833-9279