return replyto;
}
public String extractLink() {
- Pattern link = Pattern.compile("http://[^\\s]+(?=\\s)");
+ Pattern link = Pattern.compile("https?://[^\\s]+(?=\\s)");
Matcher m = link.matcher(getMessage());
m.find();
return m.group(0);
} else if (type.equals("challengeAddrBox")) {
String email = dis.readUTF();
if (approveRegex.matcher(email).matches()) {
- System.out.println("approving mbox: " + email);
dos.writeUTF("OK");
} else {
- System.out.println("rejecting mbox: " + email);
dos.writeUTF("FAIL");
}
dos.flush();
+ } else if (type.equals("ping")) {
} else {
System.err.println("Unknown type: " + type);
}
}
} catch (IOException e) {
- e.printStackTrace();
+ if (!closed) {
+ e.printStackTrace();
+ }
}
}
clearMails();
approveRegex = Pattern.compile(".*");
}
+ boolean closed = false;
+ public void destroy() {
+ try {
+ closed = true;
+ s.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}