Manual Reference Pages - MREPORT (8)
mreport - Maillog Report Generation Utility
-f | -t Summarise by from or to
-i <input file> Mail Log File (default: /var/log/maillog)
-o <output file> Output File (default: stdout)
-d <domain> Append <domain> to addresses without one
-p <string> Only addresses with <string>
-l <string> Only addresses with <string> in domain
-x <string> Exclude addresses containing <string>
-r Order by number of messages, not by size
-e Order by email address
-b <number> Flag messages greater than <number> bytes
-n <number> Nice (priority)
-m <number> Show only <number> records
-s Short form (Statistics only)
-a Show error summary
-y Dont show summary information
mreport reads the specified input file (default is /var/log/maillog), and
writes a report of mail usage to the output file (default stdout).
Usage can be summarised by size, number of email messages, or by
email addresses. At present, mreport only works with sendmail
Group information by the "from=" flag. Cant be used with
Group information by the "to=" flag. Cant be used with
-i <input file>
Read <input file> as the maillog. Default is /var/log/maillog.
-o <output file>
Write output to <output file>. Default is to stdout.
If an email record doesnt have a domain suffix, append this suffix to the
mreport -d my.domain.com will result in all records for
email@example.com and for
joe being grouped together under
firstname.lastname@example.org. An exception to this is records which include a | character, which wont
have the domain appended to them.
Only include records which have <string> in the email address.
Only include records which have <string> in the domain part
of the email address (after the @).
Exclude any records which contain <string> in the email address.
Sort the report by number of emails, not by size (default).
Sort the report by email address, not by size (default).
Flag records which are greater than this size in bytes. The record will
have a * prepended to it. Default is 500 000 bytes.
Set the priority of the process to <number>. Only root can set a negative
priority. Numbers should be between -20 and 20.
Show only the first <number> of records.
Show only statistical information. This will exclude summaries and only output
number of emails, sizes and email addresses.
Show an error summary.
Suppress summary information.
mreport will read /var/log/maillog, and produce ouput similar to the following:
* [ 85] 15345069 email@example.com firstname.lastname@example.org
* [ 92] 755031 email@example.com firstname.lastname@example.org
[ 31] 493201 email@example.com firstname.lastname@example.org
The * in the first column indicates that the number of emails
from email@example.com to firstname.lastname@example.org totalled more than
500 000 bytes (or greater than the number of bytes used with the
-b flag). The second column indicates the number of emails, the
third their total size, the next column is who the email is from
and the final column is who it is to.
If used with the -f flag, only one column of email addresses
will be shown, which will be the summary of the from=
addresses. Similarly, if -t is used, only to= summaries will be
The last part of the output will summarise the following fields, unless
the -y flag is used:
Total Bytes :
Number of Records :
Deferred Messages :
Host Unknown :
User Unknown :
Premature EOM Error :
I/O Error :
Service Unavailable :
We Dont Relay :
Host Name :
Input File :
Output File :
First Record :
Last Record :
Time Taken :
mreport -i /var/log/maillog.2 |
Use /var/log/maillog.2 as the input file.
mreport -o /home/jason/maillog.output |
Write output to /home/jason/maillog.output.
mreport -f -b 1000000 -p elvis |
Summarise mail from, flag records greater than 1 Mb, only include
records which contain elvis in the from email address.
mreport -t -d datrix.co.za -l datrix.co.za -e -y |
Summarise mail to, and use the domain suffix
datrix.co.za if the email address does not contain one. Only include records
where the domain section of the to address contains the string
-d option is used before the string selection. Sort the output by email address.
Dont include a summary.
mreport -f -x lists.domain.com -r -s -m 10 -i /var/log/maillog.1 |
Summarise by from, exclude from email addresses containing
'lists.domain.com'. Sort by number of messages and produce output in
summarised form. Show only the first ten records. Use /var/log/maillog.1
as the input file.
mreport makes some assumptions about the format of the sendmail log file.
Among these are:
The first sixteen bytes of each line are the date:
[Dec 5 02:08:49 ]
The ID number of the message is placed before the from=
field, and is delineated by colons:
[: CAA04848: from=root,]
The to= field ends with a comma, though it tries to handle
cases where this doesnt occur. The end of this field is tested
for by looking for a delay= or a ctladdr= string.
mreport can be used with the logrotate(8)
program to produce output every time the maillog is rotated. Use within the
prerotate / endscript directives, and pipe the ouput to mail(1).
mreport -f | mail -s "[MREPORT] From" root
mreport -t | mail -s "[MREPORT] To" root
Jason Armstrong <email@example.com>
|--> ||MREPORT (8) ||January 18, 2000 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.