webadept has asked for the wisdom of the Perl Monks concerning the following question:
$spamx = $spamdir.$spamfile; $pop = new Mail::POP3Client( USER => $account, PASSWORD => $passwd, HOST => $server) || die $pop->Message(); #$pop->Connect() >= 0 || die $pop->Message(); for( $i = 1; $i <= $pop->Count(); $i++ ) { foreach( $pop->Head( $i ) ) { if(/^(X-Spam-Score):\s+/i) { $_ =~ s/[a-z \(\-\):,_\*\s]//ig; chomp; if($_ > $threshold) { open(OUT, ">>$spamx") || open(OUT,">$spamx") || die + "could not open Spam file "; $pop->Retrieve($i); if(print OUT $pop->Body($i), "\n\n") { $pop->Delete($i); } else { print "Spam filter file can't be written too, Stoppin +g Program \n\n"; exit; } close(OUT); print $_ , "\n"; } } } # end foreach loop # } # end for every message in spool # $pop->Close();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mail::POP3Client Delete
by webadept (Pilgrim) on Sep 08, 2002 at 03:41 UTC | |
by Anonymous Monk on Oct 22, 2018 at 06:08 UTC |