Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SU-470 : Mail Configuration - Remove authentification #1358

Merged
merged 4 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ class EmailService {
this.properties.put("mail.smtp.socketFactory.port", "465");
this.properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");

} else {
} else if (config.tls) {
this.properties.put("mail.smtp.port", "587")
} else {
this.properties.put("mail.smtp.port", "25")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,10 @@ public void sendCompensationAlertEmail(String to, String subject, String body) {

private Properties getJavaMailProperties(SMTPCredentialsData smtpCredentialsData) {
Properties properties = new Properties();
properties.put("mail.smtp.starttls.enable", "true");
properties.put("mail.smtp.starttls.enable", "false");
properties.put("mail.transport.protocol", "smtp");
properties.put("mail.smtp.auth", "false");
properties.put("mail.smtp.ssl.trust", smtpCredentialsData.getHost());
if (smtpCredentialsData.isUseTLS()) {
if (smtpCredentialsData.getPort().equals("465")) {
properties.put("mail.smtp.starttls.enable", "false");
}
}
return properties;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void sendEmailWithAttachment(EmailMessageWithAttachmentData emailMessageW
}

private Properties getJavaMailProperties(SMTPCredentialsData smtpCredentialsData, Properties properties) {
properties.put("mail.smtp.starttls.enable", "true");
properties.put("mail.smtp.starttls.enable", "false");
properties.put("mail.transport.protocol", "smtp");
properties.put("mail.smtp.auth", "false");
properties.put("mail.smtp.ssl.trust", smtpCredentialsData.getHost());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private Properties getJavaMailProperties(Collection<ReportMailingJobConfiguratio
Properties properties = new Properties();

properties.setProperty("mail.smtp.auth", "false");
properties.setProperty("mail.smtp.starttls.enable", "true");
properties.setProperty("mail.smtp.starttls.enable", "false");
properties.setProperty("mail.smtp.ssl.trust", this.getGmailSmtpServer(reportMailingJobConfigurationDataCollection));

return properties;
Expand Down
Loading