[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Sheflug] Perl Modules
Hi
Anyone done anything with Mail::Audit before ?
I'm trying to work out how to use Mail::Audit::KillDups and the reject
option for returning mail to a foreign host after a dcc check.
Perldoc Mail::Audit reveals....
use Mail::Audit; # use Mail::Audit qw(...plugins...);
my $mail = Mail::Audit->new(emergency=>"~/emergency_mbox");
$mail->pipe("listgate p5p") if $mail->from =~
/perl5-porters/;
$mail->accept("perl") if $mail->from =~
/perl/;
$mail->reject("We do not accept spam") if $mail->rblcheck();
$mail->ignore if $mail->subject =~
/boring/i;
"reject($reason)"
This rejects the email; it will be bounced back to the
sender as undeliverable. If a reason is given, this
will be included in the bounce.
This is a final delivery method. The "noexit" option
has no effect here."
I'm trying to work out how to integrate this into my present script
along with KillDups. My present Mail::Audit script is below...
#!/usr/bin/perl
use strict;
use warnings;
use Mail::Audit;
use Mail::SpamAssassin;
my $mailbox = "/home/user/Mail/inbox";
my $mail = Mail::Audit->new( nomime => 1, );
my $spamtest = Mail::SpamAssassin->new();
my $status = $spamtest->check( $mail );
if ( $status->is_spam() ) {
$status->rewrite_mail();
$mail->accept( "/dev/null" );
} else {
$mail->accept( "home/user/Mail/inbox" );
}
This works well but some improvement can be made with KillDups and
reject as long as I use dcc with it.
Richard
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.