.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 "SENDMAIL2DLF.IN 1" .TH SENDMAIL2DLF.IN 1 "2020-07-07" "Lire 2.1.1" "LogReport's Lire 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" sendmail2dlf \- convert sendmail logfiles to dlf .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBsendmail2dlf\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBsendmail2dlf\fR\|(1) converts a LogLevel 9 sendmail (8.10.x or higher) logfile, as created using syslog, to a Lire email Distilled Log Format file. .PP Input is one line per event. Outputted is one line per delivery: .PP .Vb 2 \& time logrelay queueid msgid fromuser fromdomain fromrelay \e \& size delay xdelay touser todomain torelay stat .Ve .PP (This should be the format as defined in email/dlf.cfg.) .SH "EXAMPLE" .IX Header "EXAMPLE" The lines .PP .Vb 12 \& Apr 20 03:00:11 firewall sendmail[442]: DAA00442: \e \& from=, size=4992, class=0, \e \& pri=34992, nrcpts=1, \e \& msgid=<200004192316.BAA19611@achilles.noot.com>, \e \& proto=ESMTP, relay=host.example.nl [150.0.0.45] \& Apr 20 03:00:11 firewall sendmail[442]: DAA00442: \e \& to=, delay=00:00:00, mailer=smtp, \e \& stat=queued \& Apr 20 05:00:11 firewall sendmail[503]: DAA00442: \e \& to=, delay=02:00:00, \e \& xdelay=00:00:03, mailer=smtp, relay=mailgw.aap.com. \e \& [3.4.64.199], stat=Sent (OK id=12i7CN\-0001Kv\-00) .Ve .PP wil be converted to .PP .Vb 10 \& 956109611 firewall DAA00442 \e \& <200004192316.baa19611@achilles.noot.com> user \e \& example.com host.example.nl_[150.0.0.45] 4992 0 0 \e \& jan aap.com host.example.nl._[150.0.0.45] queued \e \& UNKNOWN \& 956116811 firewall DAA00442 \e \& <200004192316.baa19611@achilles.noot.com> user \e \& example.com host.example.nl_[150.0.0.45] 4992 \e \& 7200 3 jan aap.com mailgw.aap.com._[3.4.64.199] \e \& sent (ok_id=12i7cn\-0001kv\-00) .Ve .PP The lines .PP .Vb 10 \& Mar 17 13:34:32 mailhost sendmail[8408]: NAA08408: \e \& from=, size=1890, class=0, \e \& pri=0, nrcpts=4, \e \& msgid=<000b01bf9009$f6885b20$6c062014@sabepc06.be.example.com>, \e \& proto=ESMTP, relay=root@[1.2.6.10] \& Mar 17 13:45:26 mailhost sendmail[8457]: NAA08408: \e \& to=lkrksen@www, delay=00:10:56, xdelay=00:00:01, \e \& mailer=smtp, relay=www.example.nl. [194.229.43.3], \e \& stat=Sent (NAA06261 Message accepted for delivery) \e \& Mar 17 13:45:27 mailhost sendmail[8457]: NAA08408: \e \& to=ll@host.example.com, delay=00:10:57, \e \& xdelay=00:00:01, mailer=smtp, relay=host.example.nl. \e \& [150.0.0.45], stat=Sent (OK) \& Mar 17 13:45:31 mailhost sendmail[8457]: NAA08408: \e \& to=,,, \e \& delay=00:11:01, xdelay=00:00:04, mailer=smtp, \e \& relay=mailgw.aap.com. [3.4.64.199], stat=Sent (OK \e \& id=12Vw8J\-0001iT\-00) .Ve .PP will be converted to .PP .Vb 10 \& 953210726 mailhost NAA08408 \e \& <000b01bf9009$f6885b20$6c062014@sabepc06.be.example.com>\e \& piet example.com root@[1.2.6.10] 1890 656 1 lkrksen \e \& www www.example.nl._[194.229.43.3] sent \e \& (naa06261_message_accepted_for_delivery) \& 953210727 mailhost NAA08408 \e \& <000b01bf9009$f6885b20$6c062014@sabepc06.be.example.com> \e \& piet example.com root@[1.2.6.10] 1890 657 1 ll \e \& host.example.com host.example.nl._[150.0.0.45] sent (ok) \& 953210731 mailhost NAA08408 \e \& <000b01bf9009$f6885b20$6c062014@sabepc06.be.example.com> \e \& piet example.com root@[1.2.6.10] 1890 661 4 mvelsla \e \& aap.com mailgw.aap.com._[3.4.64.199] sent \e \& (ok_id=12vw8j\-0001it\-00) \& 953210731 mailhost NAA08408 \e \& <000b01bf9009$f6885b20$6c062014@sabepc06.be.example.com> \e \& piet example.com root@[1.2.6.10] 1890 661 4 pvhove \e \& aap.com mailgw.aap.com._[3.4.64.199] sent \e \& (ok_id=12vw8j\-0001it\-00) \& 953210731 mailhost NAA08408 \e \& <000b01bf9009$f6885b20$6c062014@sabepc06.be.example.com> \e \& piet example.com root@[1.2.6.10] 1890 661 4 pdebaerd \e \& aap.com mailgw.aap.com._[3.4.64.199] sent \e \& (ok_id=12vw8j\-0001it\-00) .Ve .PP The lines .PP .Vb 10 \& Mar 15 13:34:09 firewall sendmail[279]: NAA00279: \e \& from=, size=2281952, class=0, \e \& pri=2311952, nrcpts=1, \e \& msgid=<200003151230.NAA00112@mailhost.example.nl>, \e \& proto=ESMTP, relay=host.example.nl [150.0.0.45] \& Mar 15 13:34:09 firewall sendmail[279]: NAA00279: \e \& to=, delay=00:00:04, mailer=smtp, \e \& stat=queued \& Mar 15 13:39:58 firewall sendmail[401]: NAA00279: \e \& to=, delay=00:05:53, xdelay=00:00:06, \e \& mailer=smtp, relay=mc5.law5.hotmail.com. \e \& [216.32.243.136], stat=Service unavailable \& Mar 15 13:39:58 firewall sendmail[401]: NAA00279: \e \& NAA00401: postmaster notify: Service unavailable \& Mar 15 13:40:04 firewall sendmail[401]: NAA00401: \e \& to=klaas@host.example.com, delay=00:00:06, \e \& xdelay=00:00:04, mailer=smtp, relay=host.example.nl. \e \& [150.0.0.45], stat=Sent (OK) .Ve .PP will be converted to .PP .Vb 10 \& 953037249 firewall NAA00279 \e \& <200003151230.naa00112@mailhost.example.nl> klaas \e \& example.com host.example.nl_[150.0.0.45] 2281952 4 1 \e \& klaas hotmail.com mailgw.csc.com._[208.219.64.199] \e \& queued UNKNOWN \& 953037598 firewall NAA00279 \e \& <200003151230.naa00112@mailhost.example.nl> klaas \e \& example.com host.example.nl_[150.0.0.45] 2281952 353 6 \e \& klaas hotmail.com mc5.law5.hotmail.com._[216.32.243.136] \e \& service unavailable .Ve .PP The fact that the delivery 'Mar 15 13:40:04 firewall sendmail[401]: \&\s-1NAA00401:\s0' does not generate a dlf record is a bug. .PP When the line .PP .Vb 3 \& Mar 15 19:39:40 mailhost sendmail[2178]: TAA02178: \e \& from=, size=0, class=0, pri=0, \e \& nrcpts=0, proto=SMTP, relay=[1.84.7.150] .Ve .PP occurs in the input, and there is no line carrying the same queueid, the line is discarded, and reported as skipped: any to\- or from\- line, lacking any partner, will get discarded. .PP Lines like: .PP .Vb 2 \& Mar 15 13:40:19 firewall sendmail[456]: alias database \e \& /etc/aliases.db out of date .Ve .PP wil get discarded .SH "EXAMPLES" .IX Header "EXAMPLES" To process a log as produced by sendmail: .PP .Vb 1 \& $ sendmail2dlf < mail.log .Ve .PP sendmail2dlf will be rarely used on its own, but is more likely called by lr_log2report: .PP .Vb 1 \& $ lr_log2report sendmail < /var/log/maillog .Ve .SH "BUGS" .IX Header "BUGS" When queueids are being reused within one logfile, behaviour is unpredictable. Incomplete logsnippets (e.g. from-lines without to-lines) are not treated well. .PP It is reported events like this occur in sendmail log files: .PP .Vb 10 \& SAA14845: from=<>, size=146990, class=0, pri=176990, nrcpts=1, \& msgid=<092246.09986@rly\-yc03.mx.aol.com>, proto=ESMTP, \& relay=omr\-d06.mx.aol.com [205.188.156.71] \& SAA14845: to=joe@mailhost, ctladdr=, delay=00:00:01, \& mailer=local, stat=User unknown \& SAA14845: to=, delay=00:00:01, mailer=local, \& stat=User unknown \& SAA14845: SAA14846: postmaster notify: User unknown \& SAA14846: to="|exec /usr/local/bin/procmail", ctladdr=ann@mailhost (2217/10), \& delay=00:00:00, xdelay=00:00:00, mailer=prog, stat=Sent \& SAA14846: to=bob@imap\-ns, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, \& relay=apex.example.edu. [152.19.4.80], \& stat=Sent (Message received: GVV8N400.CMX) \& SAA14846: to=eve@mailhost, delay=00:00:01, xdelay=00:00:00, mailer=local, \& stat=Sent .Ve .PP Note that \s-1SAA14845\s0 has _two_ final to= lines, while the from= line states nrcpts=1. This blows the axiom of this script away. We haven't decided yet on how to deal with this... .SH "THANKS" .IX Header "THANKS" Edward Eldred, for finding and reporting a bug. .SH "VERSION" .IX Header "VERSION" \&\f(CW$Id:\fR sendmail2dlf.in,v 1.32 2006/07/23 13:16:34 vanbaal Exp $ .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2000, 2001, 2002 Stichting LogReport Foundation LogReport@LogReport.org .PP This program is part of Lire. .PP Lire is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \&\s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program (see \s-1COPYING\s0); if not, check with http://www.gnu.org/copyleft/gpl.html. .SH "AUTHOR" .IX Header "AUTHOR" Joost van Baal