Author: msergeant
Date: Fri Sep 26 10:39:42 2008
New Revision: 945

Modified:
   trunk/plugins/require_resolvable_fromhost

Log:
Fix to check all MX hosts, not just the first


Modified: trunk/plugins/require_resolvable_fromhost
==============================================================================
--- trunk/plugins/require_resolvable_fromhost   (original)
+++ trunk/plugins/require_resolvable_fromhost   Fri Sep 26 10:39:42 2008
@@ -53,8 +53,14 @@
   $res->udp_timeout(30);
   my @mx = mx($res, $host);
   foreach my $mx (@mx) {
-    return mx_valid($self, $mx->exchange, $host);
-  }
+    # if any MX is valid, then we consider the domain
+    # resolvable
+    return 1 if mx_valid($self, $mx->exchange, $host);
+  }
+  # if there are MX records, and we got here,
+  # then none of them are valid
+  return 0 if (@mx > 0);
+
   my $query = $res->search($host);
   if ($query) {
     foreach my $rrA ($query->answer) {

Reply via email to