SMA(8)
π NAME π
okay so, this is sma(8) β the System Manager's Manual page for sma, aka the Sendmail Log Analyser. say hi bestie π«Ά
β¨ SYNOPSIS β¨
sma [OPTIONS] [file ...]
π¦ DESCRIPTION π¦
so sma reads sendmail log entries and spits out a whole summary of your mail activity. it takes input from a file or from standard input, and it writes the report to standard output or to a file. simple, clean, iconic π
you can configure sma with command line options, or with a configuration file, or both at once β but heads up, command line options always win over the configuration file. no cap, they override every time. π
π OPTIONS π
here's the full menu of command line flags, no skips, we're doing all of them:
-Aβ downcase all addresses. this is sofoo@bar.comis equivalent toFOO@BAR.ComandFoo@Bar.comand they all get counted the same in the counts. usually you're interested in the user, not the format of the address, and since email addresses are case insensitive to MTAs, you might want to make them case insensitive insmatoo. β¨-aβ format the report as ASCII.-bcolor β set the background color of the HTML report as color. π¨-Cstring β set the report header as string.-Ddate1,date2 β process a log entry only if the date is between date1 and date2. the date format is literally this:
[[[[[[cc]yy]mm]dd]HH]MM[.SS]]
and the parts go like:
yyβ year in abbreviated form (for years 1969-2068). the formatccyymmddHHMMis 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, the current date is used. π°οΈ
-cβ print the copyright notice and exit.-dβ process only the domain portion of the email address.-ffile β read the configuration from file instead of the default configuration file. the default configuration file is defined inconf.h.-Fβ do not use the default configuration file even if it exists. bold. π-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 an HTML comment (this requires-wor-O html). β οΈ-nβ do not report the time distribution.-ofile β print the report as file. if it's not given, it prints to stdout.-Oformat β format the report as format. possible values for format areascii,htmlandclog.-pβ print current configuration to stdout. π«Ά-sβ sort by transfers. the default is by number of messages.-tvalue β adjust the internal hash table size. possible values for value arenormal,bigandhuge.-qβ do not print any warning messages. π€«-lnum β number of the top senders and recipients in the report. default is10.-rnum β number of the top relay senders and recipients in the report. default is5.-vβ print some debugging information for each parsed line. π-wβ format the report as HTML.
π KEYWORDS π
the sma configuration file is made of keyword-value pairs. here's every available configuration file keyword and value, in order, because we don't gatekeep here:
BgColorRGB β set the HTML report background color as RGB. command line option:-bBounceAddressstring β set the error message bounce address as string.CaseSensitivevalue β set filter case sensitivity. possible values areyesorno. this option requires theUSE_REGEXPcompile time definition.DowncaseAddressesvalue β set whether or not to make all addresses lower case, to make counts for users more accurate. possible values areyesorno.ClogFormatstring β formatting string for Custom Log format. format consists of ordinary characters and various two-character sequences which get replaced with built-in variables, like so:%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 asyes, print only sent messages (status = 1).Commentstring β set report header as string. command line option:-CDebugvalue β if value is set asyes, print debugging information to stderr. command line option:-vEndTimedate β process a log entry only if the date is before date. the format of the date isYYYY/MM/DD-HH:MM:SS. command line option:-DEnvelopePairsnumber β set the number of the top envelope pairs as number.EnvelopeRecipientFilterstring β set the envelope recipient filter as string. ifsmais compiled withUSE_REGEXP, string can be a regular expression of the syntax defined inre_format(7). otherwise the standard C library functionstrstr()is used. if the first character of string is'!', the filter is reversed. πEnvelopeRecipientsnumber β set the number of the top envelope recipients as number. command line option:-lEnvelopeSenderFilterstring β set the envelope sender filter as string. see also theEnvelopeRecipientFilterkeyword.EnvelopeSendersnumber β set the number of the top envelope senders as number. command line option:-lFooterTextstring β set the report footer as string.Formatstring β set the output format as string. possible values areascii,htmlandclog. command line options:-a,-wand-OHashTablesstring β adjust the internal hash table size. possible values arenormal,bigandhuge. it's also possible to specify a custom hash table size by defining two values and separating them with a comma','. command line option:-tHeaderTextstring β set the report header as string.HostNamestring β set the hostname as string. normally,HostNameis taken from log files, or, in the case of Sendmail for NT, from the compile time defineHOSTNAME. command line option:-HIncludeAsciivalue β include the ASCII report as an HTML comment. possible values areyesorno. command line option:-iOutFilefile β print the report as file. command line option:-oPictureALTstring β ifPictureURLis defined, set the ALT text inside the IMG HTML-tag as string.PictureLinkstring β ifPictureURLis defined, make the picture a link pointing to string.PictureParametersstring β ifPictureURLis defined, set additional IMG parameters as string.PictureURLURL β include a picture with source URL as URL in the HTML report. the picture appears in the upper left corner of the page. see also thePictureParameters,PictureALTandPictureLinkkeywords. πΌοΈPrintGeneralInfovalue β print the General Information section in the report. possible values areyesorno.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 the report. possible values areyesorno. command line option:-nRelayPairsnumber β set the number of the top relay address pairs as number.RelayRecipientFilterstring β set the relay recipient filter as string. see also theEnvelopeRecipientFilterkeyword.RelayRecipientsnumber β set the number of the top relay recipients as number. command line option:-rRelaySenderFilterstring β set the relay sender filter as string. see also theEnvelopeRecipientFilterkeyword.RelaySendersnumber β set the number of the top relay senders as number. command line option:-rShowUsersvalue β if value is set asno, process only the domain portion of the email address. command line option:-dSilentvalue β if value is set asyes, do not print error messages. command line option:-qSortingvalue β set the sort order as value. possible values arenumberortransfer. command line option:-sSyslogTagstring β process only lines with syslog tag string. command line option:-LStartTimedate β process a log entry only if the date is after date. the format of the date isYYYY/MM/DD-HH:MM:SS. command line option:-DTbColorRGB β set the HTML report table corner color as RGB. β¨
πΈ FILES πΈ
sma can, as an option, use a configuration file. its default location can be configured using the compile time define DEFAULT_CONF in the file conf.h. by default, it is defined as ./sma.conf. π
π AUTHOR π
Jarkko Turkulainen <jt@klake.org> β thank you for your service king π«‘
π BUGS π
okay so, the tea: sma takes the year from the runtime year. it knows nothing about the new year transitions in log files. like, nothing nothing. π
also, and I quote, the documentation contains a lot of bad english. we've all been there bestie, no judgement π
and that's the whole page!! this was the SMA(8) page, straight out of the System Manager's Manual, shipped by Debian, dated October 28, 2001. periodt. ππβ¨
π¦ where this page comes from
- debian bookworm: sma 1.4-3.1
- debian trixie: sma 1.4-3.1
- ubuntu jammy: sma 1.4-3.1
- ubuntu noble: sma 1.4-3.1
- ubuntu resolute: sma 1.4-3.2 Β· BSD-2-Clause
- ubuntu stonking: sma 1.4-3.2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms