my $spf = Mail::SPF::Iterator->new( $ip, # SMTP Client IP $mailfrom, # MAIL FROM: mailfrom $helo, # HELO|EHLO helo $myname # lokaler Name des Servers ); my ($result,@ans) = $spf->next; while ( ! $result ) { my $answer = ...dns lookup @ans ... ($result,@ans) = $spf->next($answer) }