Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: mail filtering
- To: tlug@example.com
- Subject: Re: mail filtering
- From: Simon Cozens <simon@example.com>
- Date: Fri, 24 Nov 2000 11:50:53 +0000
- Content-Disposition: inline
- Content-Type: text/plain; charset=us-ascii
- In-Reply-To: <3A1E21D8.A723B64C@example.com>; from 9915104t@example.com on Fri, Nov 24, 2000 at 05:07:30PM +0900
- References: <3A1E21D8.A723B64C@example.com>
- Reply-To: tlug@example.com
- Resent-From: tlug@example.com
- Resent-Message-ID: <4y4EU.A.Hv.vYlH6@example.com>
- Resent-Sender: tlug-request@example.com
- Sender: Simon Cozens <simon@example.com>
- User-Agent: Mutt/1.2.5i
On Fri, Nov 24, 2000 at 05:07:30PM +0900, B0Ti wrote: > I'd like to do mail filtering on a system (I think it is IRIX), which > doesn't have procmail, filter, mailagent installed. > What other unix tools would accomplish a similar task ? May I humbly suggest Mail::Audit, a very simple Perl module? You can download and run it as a user, and it's (in my humble opinion) much easier to use than procmail. (That is, if you know Perl) It's also far more powerful. Consider: #!/usr/bin/perl use lib "/home/simon/plib/"; # This is where your modules are installed use Mail::Audit; open (LOG, ">>/home/simon/.audit_log"); # Don't die on failure, we'll lose mail! $folder ="/home/simon/mail/"; my $item = Mail::Audit->new(); my $from = $item->from(); my $to = $item->to(); my $cc = $item->cc(); my $subject = $item->subject(); chomp($from,$to,$subject); my %lists = ( "tlug" => "tlug", "perl5-porters" => "p5p", # ... ) for my $what (keys %lists) { my $where = $lists{$what}; if ($from =~ /$what/i or $to =~ /$what/i or $cc =~/$what/i) { print LOG "INCOMING MAIL:$from:$subject:List $where\n"; $item->accept($folder.$where); } } for (@example.com) { if ($from =~ /$_/i) { print LOG "INCOMING MAIL:$from:$subject:Rejected - spam\n"; $item->reject("We do not accept spam"); } } # Query mail that is not addressed to me. if ($to !~ /simon|pemb0468/ and $cc !~ /simon|pemb0468/) { print LOG "INCOMING MAIL:$from:$subject:Spam?? (Questionable)\n"; $item->accept($folder."questionable"); # For the time being. } $item->accept(); # Put it in the inbox -- My sister married a German. He complained he couldn't get a good bagel back home. I said: 'Well, whose fault is that?' - Emo Philips
- References:
- mail filtering
- From: B0Ti <9915104t@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: mail filtering
- Next by Date: about XFree86-3.3.3
- Prev by thread: Re: mail filtering
- Next by thread: about XFree86-3.3.3
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links