bug-mailfromd


Search for: Advanced

[Bug-mailfromd] spam getting through in 9.0 on custom module


I have this code/module[1]. It looks like this is not working any more since upgrading to 9.0 I have. Nothing is being matched. Any idea what this can be? Or maybe there is a new solution for this?


match_dnsbl_ret ($client_addr, "rbl.example.com", "127.0.0.32/32", "127.0.0.2/32")



[1]
static func match_dnsbl_range(string address, string zone, string iprange)
  returns number
do
  if iprange = 'ANY'
    set iprange '127.0.0.0/8'
  fi

  if address matches
    '^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$'
    string res resolve ("\4.\3.\2.\1", zone)
    if res == "0"
      return 0
    fi
    if match_cidr (res, iprange)
      set dnsbl_result res
      return 1
    else
      return 0
    fi
  else
    throw e_invip "%address: invalid IP address"
  fi
  # never reached
done

func match_dnsbl_ret(string address, string zone, string ...)
  returns number
do
  loop for number i 1,
       while i < $# - @zone,
       set i i + 1
  do
    if match_dnsbl_range(address, zone, $(i))
      return 1
    fi
  done
  return 0
done