[Mimedefang] Saving Headers for report

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Mon May 10 10:04:07 EDT 2004


On Mon, 10 May 2004, Jerome Tytgat wrote:

>   my $logf = "$logd/${MsgID}-Report-" . localtime() . ".txt";

I added localtime() only for internal purposes; the MsgID should be
suficient for most purposes, hence, you could avoid this function.

>     print LOG $report;

Actually, this is my report assembled for the message during the
filter_begin().._end() triplet, it is more-or-less this:

$report = "Status report " . $_[0] . ":\n\n" . Data::Dumper->Dump( [
                ## my values
                \@ska_SpamValues,
                $isFHSender,
                $isInfSender,
                $oneRcptIsList,
                $oneRcptIsMe,
                $lcSender,

                # message stuff
                $Helo,
                $Sender,
                $Subject,
                $Domain,
                $MessageID,
                $QueueID,
                $MsgID,
                $RelayAddr,
                $WasResent,
                $RelayHostname,
                $RealRelayAddr,
                $RealRelayHostname,
                $SuspiciousCharsInHeaders,
                $SuspiciousCharsInBody,
...
        ] , [ qw(
                *ska_SpamValues
                isFHSender
                isInfSender
                oneRcptIsList
                oneRcptIsMe
                lcSender
                Helo
                Sender
                Subject
                Domain
                MessageID
                QueueID
                MsgID
                RelayAddr
                WasResent
                RelayHostname
                RealRelayAddr
                RealRelayHostname
                SuspiciousCharsInHeaders
                SuspiciousCharsInBody
...
        )]);

$report .= "Sender authentification: by relay\n";
$report .= "Skipping SpamAssassin: too large\n";

a.s.o You get the idea.

The Data::Dumper module formats nicely as known from the "x"  command of
the perl debugger. However, some of the values still contain "left-overs"
from previous useages of the same slave, as the variables are not undef'ed
by default. Esp. during debugging new changes I do a full log of all
MIMEDefang variables.

Bye,

-- 
Steffen Kaiser



More information about the MIMEDefang mailing list