[Mimedefang] Failing filter snippet (was More filter_recipie nt Qs...)

Matthew.van.Eerde at hbinc.com Matthew.van.Eerde at hbinc.com
Fri Jul 9 16:06:38 EDT 2004


> From: David F. Skoll [mailto:dfs at roaringpenguin.com]
> 
> On Fri, 9 Jul 2004, Ashley M. Kirchner wrote:
> 
> > sub filter_recipient {
> >     my($recipient, $sender, $rest) = @_;
> >     if ($recipient =~ /.+\@pcraft\.com>?/i) {
> >         my($answer, $explanation) =
> >             md_check_against_smtp_server($sender, $recipient,
> >                  "serpico.pcraft.com", "ivanhoe.pcraft.com");
> >     } else {
> 
> Your $answer and $explanation variables go out of scope after the
> close bracket, so later on...
> 
> >     # Convert TEMPFAIL to CONTINUE
> >     $answer = 'CONTINUE' if ($answer eq 'TEMPFAIL');
> >     return ($answer, $explanation);
> 
> $answer and $explanation are undefined.
> 
sub filter_recipient {
    my($recipient, $sender, $rest) = @_;
+++ my ($answer, $explanation); 
   if ($recipient =~ /.+\@pcraft\.com>?/i) {
---        my($answer, $explanation) =
+++		($answer, $explanation) =
            md_check_against_smtp_server($sender, $recipient,
                 "serpico.pcraft.com", "ivanhoe.pcraft.com");
    } else {
---        my($answer, $explanation) =
+++        ($answer, $explanation)
            md_check_against_smtp_server($sender, $recipient,
                 "serpico.pcraft.com", "fargo.pcraft.com");
    }
    # Convert TEMPFAIL to CONTINUE
    $answer = 'CONTINUE' if ($answer eq 'TEMPFAIL');
    return ($answer, $explanation);
}

Matthew.van.Eerde at hbinc.com                      805.964.4554 x902
Hispanic Business Inc./HireDiversity.com         Software Engineer
perl -e"map{y/a-z/l-za-k/;print}shift" "Jjhi pcdiwtg Ptga wprztg,"



More information about the MIMEDefang mailing list