#!/usr/bin/perl #This code is designed to be used in mail handling on a catch all account #It basically uses a list of Soundex checksums to match the actual recipient #header.txt is the header part #footer.txt is teh footer part #soundex.txt is the list of soundex checksums #This was a project for OS Class #This is dirty enough :) #Note: This app written for local names. #For example: Jean-Pierre Van Den Bossche #I translasted variable names from dutch, so if I made a typo... :) use Mail::Header; use Mail::Mailer; use Text::Soundex; use strict; #Yihaaa my $domain = 'foo.bar'; #Domain my $type = 'sendmail'; #Mail::Mailer types: sendmail, mail, smtp, qmail, test my $mailprog = Mail::Mailer->new($type); my $head = new Mail::Header \*STDIN; my $subject = $head->get("subject"); my $from = $head->get("from"); my $to = $head->get("delivered-to") || $head->get("to"); chomp $subject,$from,$to; my %headers = ( 'To' => $from, 'From' => "Dolly\@$domain", #the original script I based this on was named Debby 'Subject' => 'Reply to: '.$subject ); $mailprog->open(\%headers); my @email = qw(); my ($name) = $to =~ /^([\w\.]*)\@$domain$/; my ($firstname,$lastname) = split(/\./,$name,2); my ($sfirstname,$slastname) = soundex($firstname,$lastname); open(SOUNDEX,") { chomp; my ($checksum,$email) = split(/\=\>/,$_,2); my (@list) = split(/ /,$email); my ($sfname,$slname) = split(/\./,$checksum,2); if ($sfname eq $sfirstname && $slname eq $slastname) { push(@email,@list); } } close(SOUNDEX); open(HEADER,"; $footer =