Web www.gerd-tentler.de
Version 1.3 (released May 4, 2023) [Download]

Introduction

Use this script to analyse sendmail logfiles created by the syslog daemon. It was tested with SuSE Linux 8.2. The generated report is available in HTML and ASCII format. It looks like this in HTML format:

S E N D M A I L   L O G C H E C K
© by Gerd Tentler


Messages: 6 
Traffic: 4.62 KB
sent
 6 (100.0%)
 4.62 KB (100.0%)

Messages: Top 10 by size
RankTimeFromToSizeStatus
1Jun 13 18:55:22frigga@valhalla.comfrigga@valhalla.com1320sent
2Jun 13 18:52:38joxer@olympus.comjoxer@olympus.com666sent
3Jun 13 18:42:38joxer@olympus.comjoxer@olympus.com566sent
4Jun 13 18:32:38rohit@serv1.home.comrohit@serv1.home.com466sent

Senders: Top 10 by size
RankAddressMessagesSize
1thor@valhalla.com21708
2frigga@valhalla.com11320
3joxer@olympus.com21232
4rohit@serv1.home.com1466

Recipients: Top 10 by size
RankAddressMessagesSize
1thor@valhalla.com21708
2frigga@valhalla.com11320
3joxer@olympus.com21232
4rohit@serv1.home.com1466

[ generated in 0.001 seconds ]


And this is how it looks in ASCII format:

S E N D M A I L   L O G C H E C K
(c) by Gerd Tentler

=============================================================================================
oo Messages: 6
OO Traffic : 4.62 KB
---------------------------------------------------------------------------------------------
sent                : ooooooooooooooooooooooooooooooooooooooooooooo 6 (100.0%)
                    : OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 4.62 KB (100.0%)
=============================================================================================

=============================================================================================
Messages: Top 10 by size
---------------------------------------------------------------------------------------------
      Time             From                    To                          Size  Status
---------------------------------------------------------------------------------------------
   1  Jun 13 18:55:22  frigga@valhalla.com     frigga@valhalla.com         1320  sent
   2  Jun 13 18:52:38  joxer@olympus.com       joxer@olympus.com            666  sent
   3  Jun 13 18:42:38  joxer@olympus.com       joxer@olympus.com            566  sent
   4  Jun 13 18:32:38  rohit@serv1.home.com    rohit@serv1.home.com         466  sent
=============================================================================================

=============================================================================================
Senders: Top 10 by size
---------------------------------------------------------------------------------------------
      Address                                                            Messages      Size
---------------------------------------------------------------------------------------------
   1  thor@valhalla.com                                                         2      1708
   2  frigga@valhalla.com                                                       1      1320
   3  joxer@olympus.com                                                         2      1232
   4  rohit@serv1.home.com                                                      1       466
=============================================================================================

=============================================================================================
Recipients: Top 10 by size
---------------------------------------------------------------------------------------------
      Address                                                            Messages      Size
---------------------------------------------------------------------------------------------
   1  thor@valhalla.com                                                         2      1708
   2  frigga@valhalla.com                                                       1      1320
   3  joxer@olympus.com                                                         2      1232
   4  rohit@serv1.home.com                                                      1       466
=============================================================================================

[ generated in 0.000 seconds ]

The ASCII format is useful if this class is included into a script that you run from the command line (e.g. "php -q logcheck.php").

Please note: By default, webservers like apache etc. don't have permission to read the sendmail logfile. You could copy the logfile into a password-protected directory within your webserver's document root, and change the permissions so that your webserver can access this file. Then, use the LOGCHECK-class with this file. For security reasons, you should not make the sendmail logfile world-readable.

Comments