logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

sma — Sendmail Log Analyser

Author

       Jarkko Turkulainen <jt@klake.org>

Bugs

sma takes the year from runtime year.  It knows nothing about the new year transitions in log files.

       The documentation contains a lot of bad english.

Debian                                          October 28, 2001                                          SMA(8)

Description

       The  sma  utility  analyses  sendmail log entries and produces a summary of mail activity.  sma reads the
       input from file or from standard input and writes the report to standard output or file.

       sma can be configured using command line options or configuration file, or both.   Command  line  options
       always override the configuration file.

       The available command line options are as follows:

       -A      Downcase all addresses.  This is so that foo@bar.com is equivilant to FOO@BAR.Com and Foo@Bar.com
               and  they all get counted the same in the counts.  Usually one is interested in the user, not the
               format of the address and since email addresses are case insensitive to MTAs,  one  may  want  to
               make them case insensitive in sma-a      Format the report as ASCII.

       -bcolor
               Set the background color of the HTML report as color.-Cstring
               Set report header as string.-Ddate1,date2
               Process  log  entry  only  if  the  date is between date1 and date2. The format of the date is as
               follows: [[[[[[cc]yy]mm]dd]HH]MM[.SS]] where

                     yy      Year in abbreviated form (for years 1969-2068).  The format  ccyymmddHHMM  is  also
                             permitted, for non-ambiguous years.
                     mm      Numeric month, a number from 1 to 12.
                     dd      Day, a number from 1 to 31.
                     HH      Hour, a number from 0 to 23.
                     MM      Minute, a number from 0 to 59.
                     SS      Second, a number from 0 to 61 (59 plus a maximum of two leap seconds).

               Everything  but  the  minute  is optional. The dates must be separated using a colon, without any
               whitespace characters. If either of the dates is missing, current date is used.

       -c      Print the copyright notice and exit.

       -d      Process only the domain portion of email address.

       -ffile
               Read the configuration  from  file  instead  of  the  default  configuration  file.  The  default
               configuration file is defined in conf.h.

       -F      Do not use default configuration file even if it exists.

       -Hname
               Use name as hostname.

       -Lstring
               Process only lines with syslog tag string-h      Print help message and exit.

       -i      Include the ASCII report as HTML comment (requires -w or -O html).

       -n      Do not report the time distribution.

       -ofile
               Print the report as file. If not given, print to stdout.

       -Oformat
               Format the report as format. Possible values for format are ascii, html and clog.

       -p      Print current configuration to stdout.

       -s      Sort by transfers. Default is by number of messages.

       -tvalue
               Adjust the internal hash table size. Possible values for value are normal, big and huge.

       -q      Do not print any warning messages.

       -lnum  Number of the top senders and recipients in the report. Default is 10.

       -rnum  Number of the top relay senders and recipients in the report.  Default is 5.

       -v      Print some debugging information for each parsed line.

       -w      Format the report as HTML.

Files

sma can as an option use a configuration file. It's default location can be configured  using  a  compile
       time define DEFAULT_CONF in file conf.h. By default, it is defined as ./sma.conf

Keywords

sma configuration file consists of keyword-value pairs.  Available configuration file keywords and values
       are listed below.

       BgColorRGB
               Set HTML report background color as RGB. Command line option: -bBounceAddressstring
               Set error message bounce address as string.CaseSensitivevalue
               Set  filter  case  sensitivity.  Possible  values are yes or no. This options requires USE_REGEXP
               compile time definition.

       DowncaseAddressesvalue
               Set whether or not to make all addresses lower case, to make  counts  for  users  more  accurate.
               Possible values are yes or no.ClogFormatstring
               Formatting string for Custom Log format.  format consists of ordinary characters and various two-
               character sequencies which are replaced with built-in variables as follows:

               %U      time in UNIX time format

               %D      time in form "Wed Jun 30 21:49:08 1993"

               %y      year, four digits

               %m      month, in digits

               %M      month, three letter English

               %n      minute

               %s      second

               %d      day

               %h      hour

               %H      hostname

               %z      size in bytes

               %f      envelope sender

               %t      envelope recipient

               %F      relay sender

               %T      relay recipient

               %S      status (1 = sent, 0 = error)

               %i      message id

               %%      %-character

               \n      newline

               \t      tab stop

               \\      single backslash

       ClogSentOnlyvalue
               If value is set as yes , print only sent messages (status = 1).

       Commentstring
               Set report header as string. Command line option: -CDebugvalue
               If value is set as yes , print debugging information to stderr.  Command line option: -vEndTimedate
               Process log entry only if the date is before date. The format of the date is YYYY/MM/DD-HH:MM:SS.
               Command line option: -DEnvelopePairsnumber
               Set the number of the top envelope pairs as number.EnvelopeRecipientFilterstring
               Set  envelope  recipient  filter  as  string.  If sma is compiled with USE_REGEXP , string can be
               regular expression of syntax defined in re_format(7). Otherwise the standard C  library  function
               strstr() is used. If the first character of string is '!', filter is reversed.

       EnvelopeRecipientsnumber
               Set the number of the top envelope recipients as number. Command line option: -lEnvelopeSenderFilterstring
               Set envelope sender filter as string. See also EnvelopeRecipientFilter keyword.

       EnvelopeSendersnumber
               Set the number of the top envelope senders as number. Command line option: -lFooterTextstring
               Set report footer as string.Formatstring
               Set the output format as string. Possible values are ascii , html and clog. Command line options:
               -a , -w and -OHashTablesstring
               Adjust  the  internal  hash  table  size.  Possible  values are normal , big and huge. It is also
               possible to specify a custom hash table size by defining two values and separating  them  with  a
               comma ','.  Command line option: -tHeaderTextstring
               Set report header as string.HostNamestring
               Set  the  hostname as string. Normally, HostName is taken from log files, or, in case of Sendmail
               for NT, from the compile time define HOSTNAME.  Command line option: -HIncludeAsciivalue
               Include the ASCII report as HTML comment. Possible values are yes or no. Command line option: -iOutFilefile
               Print the report as file. Command line option: -oPictureALTstring
               If PictureURL is defined, set ALT text inside the IMG HTML-tag as string.PictureLinkstring
               If PictureURL is defined, make the picture as link pointing to string.PictureParametersstring
               If PictureURL is defined, set additional IMG parameters as string.PictureURLURL
               Include a picture with source URL as URL in HTML report. The picture  appears  in  a  upper  left
               corner of the page. See also PictureParameters , PictureALT and PictureLink keywords.

       PrintGeneralInfovalue
               Print the General Information section in report. Possible values are yes or no.PrintStatusnumber
               Set the number of the top status messages as number.PrintRulenumber
               Set the number of the top ruleset rejections as number.PrintTimevalue
               Print  the  Time  Distribution  section  in  report.  Possible values are yes or no. Command line
               option: -nRelayPairsnumber
               Set the number of the top relay address pairs as number.RelayRecipientFilterstring
               Set relay recipient filter as string. See also EnvelopeRecipientFilter keyword.

       RelayRecipientsnumber
               Set the number of the top relay recipients as number. Command line option: -rRelaySenderFilterstring
               Set relay sender filter as string. See also EnvelopeRecipientFilter keyword.

       RelaySendersnumber
               Set the number of the top relay senders as number. Command line option: -rShowUsersvalue
               If value is set as no , process only the domain portion  of  the  email  address.   Command  line
               option: -dSilentvalue
               If value is set as yes , do not print error messages.  Command line option: -qSortingvalue
               Set the sort order as value. Possible values are number or transfer. Command line option: -sSyslogTagstring
               Process only lines with syslog tag string. Command line option: -LStartTimedate
               Process  log entry only if the date is after date. The format of the date is YYYY/MM/DD-HH:MM:SS.
               Command line option: -DTbColorRGB
               Set HTML report table corner color as RGB.

Name

       sma — Sendmail Log Analyser

Synopsis

sma [OPTIONS] [file...]

See Also