Added a retry counter to avoid an inifinite loop, when spamd is down: #----------------------------------------------------------------- # MOD.start #----------------------------------------------------------------- # pass rest to spamc #MOD my $checkedEmail=`spamc -f < $tmpFile`;
my $delay = 0; my $retry = 0; my $checkedEmail; do { $checkedEmail = ''; print "*** spamc delayed: $delay sec.\n" if ($delay > 0) && ($DEBUG == 1); sleep($delay); open2(*SPAMC_R,*SPAMC_W,'spamc -f'); print SPAMC_W $tmpFile; close(SPAMC_W); my $bak = $/; undef $/; $checkedEmail = <SPAMC_R>; close(SPAMC_R); $/ = $bak; $delay += 5; $retry += 1; last if $retry > 1000; } while($checkedEmail !~ /X-Spam-Flag/gms ); #----------------------------------------------------------------- # MOD.end #----------------------------------------------------------------- --Harald - To unsubscribe from this list: send the line "unsubscribe xmail" in the body of a message to [EMAIL PROTECTED] For general help: send the line "help" in the body of a message to [EMAIL PROTECTED]