selectRS = selectStmt.executeQuery();
List<String> nets = new ArrayList<String>();
while (selectRS.next()) {
nets.add(selectRS.getString(1));
}
NetMatcher matcher = new NetMatcher(nets, dns);
boolean matched = matcher.matchInetNetwork(mail.getRemoteAddr());
if (!matched) {
selectStmt = conn.prepareStatement(selectNetworks);
selectStmt.setString(1, "*");
selectStmt.setString(2, recipientHost);
selectRS = selectStmt.executeQuery();
nets = new ArrayList<String>();
while (selectRS.next()) {
nets.add(selectRS.getString(1));
}
matcher = new NetMatcher(nets, dns);
matched = matcher.matchInetNetwork(mail.getRemoteAddr());
}
return matched;
} catch (SQLException sqle) {
log("Error accessing database", sqle);
throw new MessagingException("Exception thrown", sqle);