The final one:

#-----------------------------------------------------------------
# MOD.start
#-----------------------------------------------------------------
# pass rest to spamc
#MOD my $checkedEmail=3D`spamc -f < $tmpFile`;
my $delay =3D 0;
my $maxdelay =3D 90;
my $checkedEmail;=09
do {
        # Call spamc
        $checkedEmail =3D '';
        print "*** spamc delayed: $delay sec.\n" if ($delay > 0) && ($DEBUG
=3D=3D 1);
        sleep($delay);
        open2(*SPAMC_R,*SPAMC_W,'spamc -f');
=09
        # Submit message
        open(FILE, "<$tmpFile");
        my $input =3D do{local $/;<FILE>};
        close(FILE);
        print SPAMC_W $input;
        close(SPAMC_W);

        # Get result
        $checkedEmail =3D do{local $/;<SPAMC_R>};
        close(SPAMC_R);
=09
        # Restart if spamd wasn't reached
        $delay +=3D 1;  # inc 1 second
        last if $delay > $maxdelay;
} while($checkedEmail !~ /X-Spam-Level/gmi);

#-----------------------------------------------------------------
# MOD.end
#-----------------------------------------------------------------

$maxdelay should be adapted to XMail's -QT parameter, if further filters
follow.

Thanks,
Harald


> -----Urspr=FCngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Im Auftrag von Harald Schneider
> Gesendet: Donnerstag, 27. Mai 2004 14:47
> An: [EMAIL PROTECTED]
> Betreff: [xmail] AW: Re: AW: AW: AW: [ANNOUNCE] bsa_filter.pl
>=20
>=20
> > That seems to work and saves precious keystrokes.
> > (You see, I'm getting old, and I beleive that each person
> > only has a certain number of keystrokes in their lifetime; I
> > try to save each one I can so I don't run out ;) ).
>=20
> Hehhehe ... that's very wise :)
>=20
> > Also, 1000 retries at an average of 500 x 5 seconds each
> > is 1000 x 500 x 5 =3D3D 2,500,000 seconds which is about 29 days!
> > I think I'll drop the retry count down a bit.
>=20
> I see .. this was a quick shot, also meant to save time ;)
> One more thing: $tempFile hold the file's content. In the original =3D
> script it
> holds the filename.
> But I'm sure when you are done, we got some good compressed Perl code.
>=20
> Read you,
> Harald
>=20
>=20
>=20
> >=3D20
> > Aloha =3D3D> Beau;
> >=3D20
> > -
> > 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]
> >=3D20
>=20
> -
> 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]
>=20

-
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]

Reply via email to