- if (!SMTP.Outgoing.attempt(challenge))
- throw new RuntimeException("attempted to send challenge but could not: " + m.summary());
+
+ PreparedStatement query = conn.prepareStatement("select email from pending where email=?");
+ query.setString(1, to.toString(false));
+ ResultSet rs = query.executeQuery();
+ if (rs.next()) {
+ Log.warn(this, "already challenged " + to.toString(false) + "; not challenging again.");
+ } else {
+ if (!SMTP.Outgoing.attempt(challenge))
+ throw new RuntimeException("attempted to send challenge but could not: " + m.summary());
+ }