.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "POSTGREYREPORT 1" .TH POSTGREYREPORT 1 "2023-04-30" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" postgreyreport \- Fatal report for Postfix Greylisting Policy Server .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBpostgreyreport\fR [\fIoptions\fR...] .PP .Vb 2 \& \-h, \-\-help display this help and exit \& \-\-version display version and exit \& \& \-\-user=USER run as USER (default: postgrey) \& \-\-dbdir=PATH find db files in PATH (default: /var/lib/postgrey) \& \-\-delay=N report triplets that did not try again after N seconds (default: 300) \& \-\-greylist\-text=TXT text to match on for greylist maillog lines \& \& \-\-skip_pool Skip report for \*(Aqsubscriber pools\*(Aq ( last 2 octets of IP found in PTR name ) \& \-\-skip_dnsbl=RBL RBL server to query and skip reporting for any listed hosts (SLOW!!) \& \-\-skip_clients=FILE PTR or IP or REGEXP of clients to skip in report \& \-\-match_clients=FILE *ONLY* report if fatal *AND* PTR/IP of client matches \& \& \-\-show_tries display the number of attempts failed triplets made in first column \& \-\-show_time show entry time in maillog (single line only) \& \-\-tab use tabs as separators for easy cut(1)ting \& \& \-\-nosingle_line display sender/recipients grouped by ptr \- ip \& \-\-separate_by_subnet=TXT display TXT for every new /24 (ex: "=================\en" ) \& \-\-separate_by_ip=TXT display TXT for every new IP (ex: "\en") \& \-\-check_sender=LIST one or more of: mx,mx/24,a,a/24 \& does DNS/A lookups for sender @domain and compares sending IP \& if match displays "MX" "A" or "MX/24" or "A/24" depending on LIST \& \& Note that \-\-(skip|match)_clients can be specified multiple times and there are no default files. \& Same rules apply as postgrey\*(Aqs \-\-whitelist\-clients, see postgrey doc for more info. \& \& \-\-skip_dnsbl can also be specified multiple times to query multiple DNSBL servers. .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" postgreyreport opens postgrey.db as read-only; reads a maillog via \s-1STDIN,\s0 extracts the triplets for any Greylisted lines and looks them up in postgrey.db. if the difference in first and last time seen is less than \-\-delay=N then the triplet is considered fatal and displayed to \s-1STDOUT\s0 .PP The report sorts by client \s-1IP\s0 address .SS "Note:" .IX Subsection "Note:" unless you are using \-\-lookup_by_subnet or excluding all known \s-1MTA\s0 pools you will likely have false fatal reports for \*(L"BigISPs\*(R". A message that was tried from every \s-1IP\s0 in \s-1SMTP\s0 pool before making it through will show up in the report for all of the attempted source IPs .SS "\s-1USAGE\s0" .IX Subsection "USAGE" It is best to run postgreyreport against a maillog that is at least several hours old (yesterdays?) ( you be the judge on how old is acceptable ). if you run the report against a live maillog you are not giving legit \s-1MTA\s0's enough time to try again and you will have lots of inaccurate information. .IP "\(bu" 4 Ex usage: .Sp .Vb 1 \& zcat /var/log/maillog.0.gz | ./postgreyreport [options] > postgreyreport.log \& \& or \& \& zcat /var/log/maillog.0.gz | \e \& ./postgreyreport \-\-nosingle_line \-\-check_sender=mx,a \e \& \-\-separate_by_subnet=":==================\en" \& # 94 "=" total, some were omitted for clarity .Ve .IP "\(bu" 4 Ex Output: ( \s-1POD\s0 wrapping will mess this up, view source ) .Sp .Vb 12 \& :============================================================================================ \& unknown 4.29.43.31 \& marissa_mcclendonuu@abit.com.tw user1@recipient1.com \& jake_meyerdt@ali.com.tw user2@recipient1.com \& jenny_banks_sh@translate.ru user1@recipient2.com \& rvazquezpo@ali.com.tw user3@recipient1.com \& aep@notimexico.com user2@recipient1.com \& brittneystanley_ei@cetra.org.tw user2@recipient1.com \& brendasheehan_cw@lib.ru user2@recipient1.com \& :============================================================================================ \& lsanca1\-ar5\-127\-189.biz.dsl.gtei.net 4.33.127.189 \& A fokkensr@lsanca1\-ar5\-127\-189.biz.dsl.gtei.net user2@recipient1.com \& \& cyxlfrfwciercu@publicist.com user3@recipient4.com \& :============================================================================================ \& smtpout.mac.com 17.250.248.83 \& do_not_reply@apple.com user4@recipient5.com \& \& smtpout.mac.com 17.250.248.88 \& MX legituser@mac.com user6@recipient7.com \& :============================================================================================ .Ve .SH "HISTORY" .IX Header "HISTORY" \&\fB1.14.3 20100321\fR .Sp .Vb 3 \& Some additions, Leonard den Ottolander \& New option: \-\-tab Use tabs as separator in single line mode \& New option: \-\-show_time Show entry time in maillog in single line mode .Ve .PP \&\fB1.14.2 20040715\fR .Sp .Vb 3 \& BUGFIX: (automatic) lookup\-by\-subnet support was broken, fixed. \& BUGFIX: corrected a few spelling errors \& new Option: \-\-skip_pool Skip report for \*(Aqsubscriber pools\*(Aq .Ve .PP \&\fB1.14.1 20040712\fR .Sp .Vb 6 \& Changed \-\-return\-string to \-\-greylist\-text to match postgrey \& new Option: \-\-skip_clients=FILE \& new Option: \-\-match_clients=FILE \& new Option: \-\-skip_dnsbl=RBL.DNS.NAME \& All 3 of the new options can be specified multiple times. \& Updated do_*_subsititions again to match postgrey .Ve .PP \&\fB1.11.1 20040701\fR .Sp .Vb 4 \& missing keys from DB are considered fatal triplets and included in report \& Changed \-\-delay testing from "greater than" to "greater than or equal to" \& Fixed \-\-help and \-\-man switches \& Removed setuid Notice .Ve .PP \&\fB1.6.4 20040618\fR .Sp .Vb 1 \& Initial Public Version (postgrey/contrib) .Ve .SH "AUTHOR" .IX Header "AUTHOR" Tom\ Baker\