vars.put("ticket", this.getTicket());
vars.put("subject", subject);
- String supportemailaddress = "support@" + ServerConstants.getWwwHostName().replaceFirst("^www\\.", "");
+ String supportemailaddress = ServerConstants.getSupportMailAddress();
supportNotification.sendMail(Language.getInstance(Locale.ENGLISH), vars, supportemailaddress);
} catch (IOException e) {
e.printStackTrace();
@Override
public void sendMail(String to, String subject, String message, String replyto, String toname, String fromname, String errorsto, boolean extra) throws IOException {
- String from = "support@" + ServerConstants.getWwwHostName().replaceAll("^www.", "");
+ String from = ServerConstants.getSupportMailAddress();
try (Socket smtp = new Socket(targetHost, targetPort); PrintWriter out = new PrintWriter(new OutputStreamWriter(smtp.getOutputStream(), "UTF-8")); BufferedReader in = new BufferedReader(new InputStreamReader(smtp.getInputStream(), "UTF-8"));) {
readSMTPResponse(in, 220);
out.print("HELO www.cacert.org\r\n");
return suffix;
}
+ public static String getSupportMailAddress() {
+ return "support@" + ServerConstants.getWwwHostName().replaceFirst("^www\\.", "");
+ }
+
}
imapUntil(br, "exp");
pw.println("log logout");
imapUntil(br, "log");
- assertThat(body, containsString("From: support@" + ServerConstants.getWwwHostName().replaceAll("^www.", "")));
+ assertThat(body, containsString("From: " + ServerConstants.getSupportMailAddress()));
assertThat(body, containsString("To: gigi-testuser@dogcraft.de"));
assertThat(body, containsString("Subject: " + subj));
assertThat(body, containsString(Base64.getEncoder().encodeToString(msg.getBytes("UTF-8"))));
public void testPasswordReset() throws MalformedURLException, IOException {
executeBasicWebInteraction(cookie, SupportUserDetailsPage.PATH + targetID, "aword=SecretWord&resetPass", 0);
TestMail tm;
- String targetMail = "support@" + ServerConstants.getWwwHostName().replaceFirst("^www\\.", "");
+ String targetMail = ServerConstants.getSupportMailAddress();
do {
tm = getMailReceiver().receive();
} while ( !tm.getTo().equals(targetMail));