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

Contents of /nfo/perl/scripts/dispatchmail/recieveMail

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Mon Oct 21 12:03:53 2002 UTC (21 years, 8 months ago) by joko
Branch: MAIN
CVS Tags: v001
initial checkin

1 #!/usr/bin/perl
2
3 # ==========================================================================
4 # a simple mail filter done in perl with CPAN-module "Mail::Audit"
5 # more to come ...
6 # TODO:
7 # - more sophisticated filtering
8 # - configuration-comfort (use arrays and hashes, no "matching-code-worm")
9 # - Html-Gui
10 # 2001-12-05, amo@netfrag.org
11 # ==========================================================================
12
13
14 # variables have to be declared!
15 use strict;
16
17 # ----------------------------------------------------------
18 # declare and initialize some variables
19 # these are mostly directories for routing our mail to
20 my $HOME = "/home/amo/virtual/home/amo_mail/";
21 my $MAILDIR = "$HOME/Mail";
22 my $LOGFILE = "$MAILDIR/procmail.log";
23 my $LOCKFILE = "$HOME/.procmail.lockfile";
24 my $DEFAULT = "$MAILDIR/UNSORTED/Current/Inbox";
25
26
27 # ----------------------------------------------------------
28 # main
29 # ----------------------------------------------------------
30
31 # cry for our "Auditor"
32 use Mail::Audit;
33
34 # "jump" into processing of new incoming mail and get a "handler" to this mail
35 my $incoming = Mail::Audit->new;
36
37 # - - - - - - - - - - - - - - - - - - - -
38 # process mail
39 # - - - - - - - - - - - - - - - - - - - -
40 if ($incoming->to =~ /ilo\.de/) {
41 $incoming->accept("$MAILDIR/SORTED/ilo.de/Current/Inbox");
42 }
43 if ($incoming->to =~ /web\.de/) {
44 $incoming->accept("$MAILDIR/SORTED/web.de/Current/Inbox");
45 }
46 # - - - - - - - - - - - - - - - - - - - -
47
48 # the default-handler: simply accept all mails and route them to "/var/spool/mail"
49 # $incoming->accept();
50
51 # if you want to reject all mails coming through to here, do a ...
52 # $incoming->reject;
53
54 # catch all mails and route them to a "DEFAULT"-inbox
55 $incoming->accept($DEFAULT);

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