| SMA(8) | System Manager's Manual | SMA(8) |
NAME¶
sma —
Sendmail Log Analyser
SYNOPSIS¶
sma |
[OPTIONS] [file ...] |
DESCRIPTION¶
Thesma 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.
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:
-b BounceAddressstring- Set error message bounce address as string.
CaseSensitivevalue- Set filter case sensitivity. Possible values are yes
or no. This options requires
USE_REGEXPcompile 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:
-C Debugvalue- If value is set as yes , print
debugging information to stderr. Command line option:
-v EndTimedate- 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:-D EnvelopePairsnumber- Set the number of the top envelope pairs as number.
EnvelopeRecipientFilterstring- Set envelope recipient filter as string. If
smais compiled withUSE_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:
-l EnvelopeSenderFilterstring- Set envelope sender filter as string. See also
EnvelopeRecipientFilterkeyword. EnvelopeSendersnumber- Set the number of the top envelope senders as
number. Command line option:
-l FooterTextstring- Set report footer as string.
Formatstring- Set the output format as string. Possible values are
ascii , html and
clog. Command line options:
-a,-wand-O HashTablesstring- 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:
-t HeaderTextstring- 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:
-H IncludeAsciivalue- Include the ASCII report as HTML comment. Possible values are
yes or no. Command line
option:
-i OutFilefile- Print the report as file. Command line option:
-o PictureALTstring- If
PictureURLis defined, set ALT text inside the IMG HTML-tag as string. PictureLinkstring- If
PictureURLis defined, make the picture as link pointing to string. PictureParametersstring- If
PictureURLis 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,PictureALTandPictureLinkkeywords. 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:
-n RelayPairsnumber- Set the number of the top relay address pairs as number.
RelayRecipientFilterstring- Set relay recipient filter as string. See also
EnvelopeRecipientFilterkeyword. RelayRecipientsnumber- Set the number of the top relay recipients as
number. Command line option:
-r RelaySenderFilterstring- Set relay sender filter as string. See also
EnvelopeRecipientFilterkeyword. RelaySendersnumber- Set the number of the top relay senders as number.
Command line option:
-r ShowUsersvalue- If value is set as no ,
process only the domain portion of the email address. Command line option:
-d Silentvalue- If value is set as yes , do
not print error messages. Command line option:
-q Sortingvalue- Set the sort order as value. Possible values are
number or transfer. Command
line option:
-s SyslogTagstring- Process only lines with syslog tag string. Command
line option:
-L StartTimedate- 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:-D TbColorRGB- Set HTML report table corner color as RGB.
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
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.
| October 28, 2001 | Linux 4.19.0-10-amd64 |