/usr/share/doc/libsendmail-pmilter-perl/examples/protocol-dump.pl is in libsendmail-pmilter-perl 1.00-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #!/usr/local/bin/perl -I../lib
# $Id: protocol-dump.pl,v 1.5 2004/08/02 17:55:36 tvierling Exp $
use strict;
use Carp qw(verbose);
use Sendmail::PMilter qw(:all);
# milter name should be the one used in sendmail.mc/sendmail.cf
my $miltername = shift @ARGV || die "usage: $0 miltername\n";
my %cbs;
for my $cb (qw(close connect helo abort envfrom envrcpt header eoh eom)) {
$cbs{$cb} = sub {
my $ctx = shift;
print "$$: $cb: @_\n";
SMFIS_CONTINUE;
}
}
my $milter = new Sendmail::PMilter;
$milter->auto_setconn($miltername);
$milter->register($miltername, \%cbs, SMFI_CURR_ACTS);
my $dispatcher = Sendmail::PMilter::prefork_dispatcher(
max_children => 10,
max_requests_per_child => 100,
);
$milter->set_dispatcher($dispatcher);
$milter->main();
|