import org.cacert.gigi.database.GigiPreparedStatement;
import org.cacert.gigi.util.DNSUtil;
import org.cacert.gigi.util.DomainAssessment;
+import org.cacert.gigi.util.SystemKeywords;
public abstract class EmailProvider {
protected final void sendSigned(String contents, PrintWriter output) throws IOException, GeneralSecurityException {
if (k == null || c == null) {
- output.println("Content-Transfer-Encoding: base64");
- output.println();
output.print(contents);
} else {
SMIME.smime(contents, k, c, output);
continue;
}
- pw.print("EHLO www.cacert.org\r\n");
+ pw.print("EHLO " + SystemKeywords.SMTP_NAME + "\r\n");
pw.flush();
boolean starttls = false;
do {
Socket s1 = ((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(s, host, 25, true);
br = new BufferedReader(new InputStreamReader(s1.getInputStream(), "UTF-8"));
pw = new PrintWriter(new OutputStreamWriter(s1.getOutputStream(), "UTF-8"));
- pw.print("EHLO www.cacert.org\r\n");
+ pw.print("EHLO " + SystemKeywords.SMTP_NAME + "\r\n");
pw.flush();
if ( !SendMail.readSMTPResponse(br, 250)) {
continue;
}
}
- pw.print("MAIL FROM: <returns@cacert.org>\r\n");
+ pw.print("MAIL FROM: <" + SystemKeywords.SMTP_PSEUDO_FROM + ">\r\n");
pw.flush();
if ( !SendMail.readSMTPResponse(br, 250)) {
continue;
}
- try (GigiPreparedStatement statmt = new GigiPreparedStatement("INSERT INTO `emailPinglog` SET `when`=NOW(), `email`=?, `result`=?, `uid`=?, `type`='fast', `status`=?::`pingState`")) {
+ try (GigiPreparedStatement statmt = new GigiPreparedStatement("INSERT INTO `emailPinglog` SET `when`=NOW(), `email`=?, `result`=?, `uid`=?, `type`='fast', `status`='success'::`pingState`")) {
statmt.setString(1, address);
statmt.setString(2, line);
statmt.setInt(3, forUid);
- statmt.setString(4, "success");
statmt.execute();
}
}
}
- try (GigiPreparedStatement statmt = new GigiPreparedStatement("INSERT INTO `emailPinglog` SET `when`=NOW(), `email`=?, `result`=?, `uid`=?, `type`='fast', `status`=?::`pingState`")) {
+ try (GigiPreparedStatement statmt = new GigiPreparedStatement("INSERT INTO `emailPinglog` SET `when`=NOW(), `email`=?, `result`=?, `uid`=?, `type`='fast'::`emailPingType`, `status`='failed'::`pingState`")) {
statmt.setString(1, address);
statmt.setString(2, "Failed to make a connection to the mail server");
statmt.setInt(3, forUid);
- statmt.setString(4, "failed");
statmt.execute();
}
return FAIL;