home *** CD-ROM | disk | FTP | other *** search
- #!/usr/local/bin/perl
-
- unshift(@INC, "/mnt/tchrist/scripts/deliverlib");
-
- @pw = getpwuid($<);
-
- require 'audit.pl';
- require 'mh.pl';
-
- &initialize();
-
- $HOME = $ENV{HOME}
- || $ENV{LOGDIR}
- || $pw[7]
- || die "No home directory";
-
- $USER = $ENV{USER}
- || $ENV{LOGNAME}
- || $pw[0]
- || die "Cannot determine user for id $>";
-
-
- &mh_profile();
-
- $maildrops = $MH{'path'} . '/in.coming';
-
-
- if ($subject =~ /\b(fuck|shit|damn)\b/) {
- require 'sysexits.ph';
- print STDERR <<EOF;
-
- I'm sorry, $friendly, but I simply refuse to tolerate
- such language as $1. When you can send me nice mail,
- my inbox will then accept your mail again.
-
- --tom
- EOF
- exit &EX_UNAVAILABLE;
- }
-
- # avoid duplicate messages, which are defined as
- # having the same subject, body length, body checksum,
- # and received with 10 minutes of each other.
- local($db) = "$MH{'path'}/.dupmsgdb";
- if (dbmopen(Msgs, $db, 0644)) {
- local($sum) = unpack("%31C*", $body);
- local($len) = length($body);
- if ($Msgs{$subject, $len, $sum} + 10*60 > time) {
- warn "duplicate message discarded";
- exit; # duplicate
- } else {
- $Msgs{$subject, $len, $sum} = time;
- }
- dbmclose(%Msgs);
- }
-
-
- #if ($from =~ /MAILER/ || ($from eq $USER && $subject =~ /send failed on enclosed draft/) ) {
- #warn "mailer daemon message";
- #&deliver();
- #exit;
- #};
-
- # kill any mail to 'x' aliases
- if (grep(/^x(.*)/ && (gethostbyname($1))[0], @to, @cc)) {
- # &rcvstore( "junk" );
- warn "disarding xhost message";
- exit;
- }
-
- $organization = "convex" if
- $organization eq "local" && (getpwnam($from))[0];
-
-
- if (grep(/\bbod/,@to,@cc)) {
- &rcvstore("usenix/bod");
- }
-
- for (@to, @cc) {
- if (/sage-([^,\s]+)/) {
- warn "sage message";
- &rcvstore("sage/$1");
- last;
- }
- }
-
- # default handling for mail addressed directly to me
- if (grep(/^$USER\b/o, @to, @cc)) {
- warn "message for ME";
- # &vacation();
- &deposit("$maildrops/personal");
- exit;
- }
-
-
- # this mail was not sent to me directly, so don't answer with vacation mail,
- # but do everything else.
- #
-
- &deposit("$maildrops/lists");
-
- exit;
-