email property modify
This commit is contained in:
parent
e232a6327c
commit
75b0773167
|
@ -13,7 +13,6 @@ import java.util.Properties;
|
|||
*/
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = "com.loafle.overflow")
|
||||
//@ComponentScan(basePackages = "com.loafle.overflow", includeFilters = @ComponentScan.Filter(EmailAuth.class))
|
||||
public class MailConfiguration {
|
||||
|
||||
|
||||
|
@ -29,17 +28,6 @@ public class MailConfiguration {
|
|||
@Value("${mail.protocol}")
|
||||
private String protocol;
|
||||
|
||||
@Value("${mail.properties.mail.smtp.auth}")
|
||||
private boolean smtpAuth;
|
||||
@Value("${mail.properties.mail.smtp.starttls.enable}")
|
||||
private boolean ttlEnable;
|
||||
@Value("${mail.transport.protocol}")
|
||||
private String transProtocol;
|
||||
@Value("${mail.smtps.ssl.checkserveridentity}")
|
||||
private boolean checkserver;
|
||||
@Value("${mail.smtps.ssl.trust}")
|
||||
private String sslTrust;
|
||||
|
||||
@Bean
|
||||
public JavaMailSenderImpl mailSender() {
|
||||
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
||||
|
@ -58,15 +46,26 @@ public class MailConfiguration {
|
|||
@Bean
|
||||
public Properties getJavaMailProperties() {
|
||||
Properties javaMailProperties = new Properties();
|
||||
javaMailProperties.put("mail.smtp.starttls.enable", this.ttlEnable);
|
||||
javaMailProperties.put("mail.smtp.auth", this.smtpAuth);
|
||||
javaMailProperties.put("mail.transport.protocol", this.transProtocol);
|
||||
javaMailProperties.put("mail.smtp.starttls.enable", true);
|
||||
javaMailProperties.put("mail.smtp.auth", true);
|
||||
javaMailProperties.put("mail.transport.protocol", "smtp");
|
||||
javaMailProperties.put("mail.debug", "true");
|
||||
javaMailProperties.put("mail.smtps.ssl.checkserveridentity", this.checkserver);
|
||||
javaMailProperties.put("mail.smtps.ssl.trust", this.sslTrust);
|
||||
javaMailProperties.put("mail.smtps.ssl.checkserveridentity", true);
|
||||
javaMailProperties.put("mail.smtps.ssl.trust", "*");
|
||||
|
||||
return javaMailProperties;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// @Value("${mail.properties.mail.smtp.auth}")
|
||||
// private boolean smtpAuth;
|
||||
// @Value("${mail.properties.mail.smtp.starttls.enable}")
|
||||
// private boolean ttlEnable;
|
||||
// @Value("${mail.transport.protocol}")
|
||||
// private String transProtocol;
|
||||
// @Value("${mail.smtps.ssl.checkserveridentity}")
|
||||
// private boolean checkserver;
|
||||
// @Value("${mail.smtps.ssl.trust}")
|
||||
// private String sslTrust;
|
||||
|
|
Loading…
Reference in New Issue
Block a user