~ubuntu-branches/ubuntu/trusty/libsendmail-pmilter-perl/trusty

« back to all changes in this revision

Viewing changes to examples/protocol-dump-compat.pl

  • Committer: Bazaar Package Importer
  • Author(s): Hilko Bengen
  • Date: 2004-08-14 20:08:40 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040814200840-2jhotk2vxgqiz8sa
Tags: 0.95-1
* New upstream version
  - fixes installation problems already fixed in the 0.94-1 package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/local/bin/perl -I../lib
 
2
# $Id: protocol-dump-compat.pl,v 1.2 2004/08/02 17:55:56 tvierling Exp $
 
3
#
 
4
# Similar to protocol_dump.pl, but uses the Sendmail::Milter compatibility
 
5
# interface instead.
 
6
#
 
7
 
 
8
use strict;
 
9
use Carp qw(verbose);
 
10
use Sendmail::Milter 0.18 qw(:all);
 
11
 
 
12
# milter name should be the one used in sendmail.mc/sendmail.cf
 
13
my $miltername = shift @ARGV || die "usage: $0 miltername\n";
 
14
 
 
15
my %cbs;
 
16
for my $cb (qw(close connect helo abort envfrom envrcpt header eoh eom)) {
 
17
        $cbs{$cb} = sub {
 
18
                my $ctx = shift;
 
19
 
 
20
                print "$$: $cb: @_\n";
 
21
                SMFIS_CONTINUE;
 
22
        }
 
23
}
 
24
 
 
25
Sendmail::Milter::auto_setconn($miltername);
 
26
Sendmail::Milter::register($miltername, \%cbs, SMFI_CURR_ACTS);
 
27
Sendmail::Milter::main();