/[cvs]/nfo/perl/scripts/dispatchmail/bin/dispatchmail
ViewVC logotype

Contents of /nfo/perl/scripts/dispatchmail/bin/dispatchmail

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations)
Mon Jan 27 08:52:40 2003 UTC (21 years, 11 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +9 -4 lines
+ new command line arguments: "news" and "newsgroup"

1 #!/usr/bin/perl
2
3 # ============================================================
4 #
5 # dispatchmail v0.05
6 # A simple mail filter done in perl
7 # with the Perl-module "Mail::Audit"
8 # available from CPAN.
9 #
10 # $Id: dispatchmail,v 1.4 2003/01/22 17:50:56 root Exp $
11 #
12 # ============================================================
13 # $Log: dispatchmail,v $
14 # Revision 1.4 2003/01/22 17:50:56 root
15 # - refactored most code to Mail::Audit::Dispath
16 #
17 # Revision 1.3 2003/01/22 07:16:51 root
18 # + sub traceEntry
19 # + further refactorings
20 #
21 # Revision 1.2 2003/01/22 05:38:44 collector
22 # + prepared refactoring to 'dispatchmail'
23 #
24 # ============================================================
25
26 use strict;
27 # don't use warnings;
28
29 use Data::Dumper;
30 use Getopt::Long;
31 use Hash::Merge qw( merge );
32
33 use lib qw( /data/libs/nfo/perl/libs );
34 use Mail::Audit::Dispatch;
35
36
37 # - - - - - - - - - - - - - - - - - - - -
38 # options
39 # - - - - - - - - - - - - - - - - - - - -
40
41 my $defaults = {
42 LOG => 1, # writes reports to logfile
43 VERBOSE => 1, # writes reports to STDOUT
44 TRACE => 1, # writes contents of messages to logfile
45 };
46
47 my $args;
48 GetOptions(
49 'user=s' => \$args->{user},
50 'base=s' => \$args->{base},
51 'rules=s' => \$args->{rules},
52 'mode=s' => \$args->{mode},
53 'newsgroup=s' => \$args->{newsgroup},
54 );
55
56 my $args_dispatch = merge($defaults, $args);
57
58 #print Dumper($args_dispatch);
59 #exit;
60
61 my @args_array = %$args_dispatch;
62 my $dispatcher = Mail::Audit::Dispatch->new(@args_array);
63 $dispatcher->run();
64
65 1;

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed