.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "QMAIL2DLF.IN 1" .TH QMAIL2DLF.IN 1 2025-09-28 "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 qmail2dlf \- convert sanitized qmail\-send logs to dlf .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBqmail2ldf\fR .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBqmail2dlf\fR reads qmail\-send logs from stdin, writes dlf to stdout, and, in case of errors, complains on stderr. .SH TIMESTAMPS .IX Header "TIMESTAMPS" We expect timestamps which look like e.g. \`977359048.466280500\*(Aq in our log: number of seconds since the epoch, in any precision. The log should feature lines which look something like: .PP .Vb 2 \& 982584201.511524 info msg 6426: bytes 3537 from \& qp 21089 uid 70 .Ve .PP \&\fIsplogger\fR, as distributed with qmail, writes \`a numerical timestamp\*(Aq, ie something like 972802273.627578, indicating seconds and nanoseconds since the beginning of 1970. .PP \&\fImultilog\fR, as distributed with daemontools, \&\fIhttp://cr.yp.to/daemontools.html\fR, if invoked with action \fIt\fR, writes a \&\`@\*(Aq and a \fItai64n\fR format timestamp. These timestamps look like e.g. 4000000039ef8532346bb35c. Note that 0x400000000000000000000000 is 2^62. .PP One can get the current time in \fItai64\fR format by doing: .PP .Vb 1 \& echo 40000000\`(echo obase = 16; date +%s) | bc\`00000000 .Ve .PP (assuming GNU date is installed) .PP To convert \fItai64n\fR to numerical timestamps, one can use Russ Allbery\*(Aqs tai64nfraq. It\*(Aqs in the public domain, available from \&\fIhttp://www.qmail.org/tai64nfrac\fR. .SH EXAMPLE .IX Header "EXAMPLE" To process a log as produced by splogger: .PP .Vb 1 \& $ lr_desyslog qmail < mail.log | qmail2dlf .Ve .PP To process a log as produced by multilog: .PP .Vb 1 \& $ tai64nfrac < current | qmail2dlf .Ve .PP \&\fBqmail2dlf\fR\|(1) will be rarely used on its own, but is more likely called by lr_log2report: .PP .Vb 2 \& $ tai64nfrac < /service/qmail\-send/log/main/current | \e \& lr_log2report qmail .Ve .SH BUGS .IX Header "BUGS" We don\*(Aqt deal with bounces: .PP .Vb 3 \& email qmail none qmail2dlf info skipping line \*(Aq986244190.800217 bounce msg \& 6306 qp 28445\*(Aq: first field should be one of \*(Aqnew\*(Aq, \*(Aqinfo\*(Aq, \*(Aqstarting\*(Aq, \& \*(Aqdelivery\*(Aq, \*(Aqend\*(Aq or \*(Aqstatus:\*(Aq, not \*(Aqbounce\*(Aq .Ve .PP qmail2dlf doesn\*(Aqt use any information from the \fBqmail\-smtpd\fR\|(1) logs. (These look like .PP .Vb 2 \& 2002\-06\-16 09:34:57.798038500 tcpserver: pid 19385 from 100.61.24.7 \& 2002\-06\-16 09:34:58.114198500 tcpserver: ok 19385 foo.example.com:100.163.25.11:25 logreport.iae.nl:212.61.24.7:postfix:1189 .Ve .PP \&.) .SH VERSION .IX Header "VERSION" \&\f(CW$Id:\fR qmail2dlf.in,v 1.24 2006/07/23 13:16:34 vanbaal Exp $ .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2000, 2001 Stichting LogReport Foundation LogReport@LogReport.org .PP This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. .SH AUTHOR .IX Header "AUTHOR" Joost van Baal