【优化】新增 sslEnable 字段,支持 outlook 邮箱
This commit is contained in:
parent
7f0485e872
commit
0649c315d1
@ -30,6 +30,9 @@ public class MailAccountRespVO {
|
||||
@Schema(description = "是否开启 ssl", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
private Boolean sslEnable;
|
||||
|
||||
@Schema(description = "是否开启 starttls", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
private Boolean starttlsEnable;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
@ -38,4 +38,8 @@ public class MailAccountSaveReqVO {
|
||||
@NotNull(message = "是否开启 ssl 必填")
|
||||
private Boolean sslEnable;
|
||||
|
||||
@Schema(description = "是否开启 starttls", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
@NotNull(message = "是否开启 starttls 必填")
|
||||
private Boolean starttlsEnable;
|
||||
|
||||
}
|
||||
|
@ -49,5 +49,9 @@ public class MailAccountDO extends BaseDO {
|
||||
* 是否开启 SSL
|
||||
*/
|
||||
private Boolean sslEnable;
|
||||
/**
|
||||
* 是否开启 STARTTLS
|
||||
*/
|
||||
private Boolean starttlsEnable;
|
||||
|
||||
}
|
||||
|
@ -120,7 +120,8 @@ public class MailSendServiceImpl implements MailSendService {
|
||||
String from = StrUtil.isNotEmpty(nickname) ? nickname + " <" + account.getMail() + ">" : account.getMail();
|
||||
return new MailAccount().setFrom(from).setAuth(true)
|
||||
.setUser(account.getUsername()).setPass(account.getPassword().toCharArray())
|
||||
.setHost(account.getHost()).setPort(account.getPort()).setSslEnable(account.getSslEnable());
|
||||
.setHost(account.getHost()).setPort(account.getPort())
|
||||
.setSslEnable(account.getSslEnable()).setStarttlsEnable(account.getStarttlsEnable());
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
@ -520,6 +520,7 @@ CREATE TABLE IF NOT EXISTS "system_mail_account" (
|
||||
"host" varchar NOT NULL,
|
||||
"port" int NOT NULL,
|
||||
"ssl_enable" bit NOT NULL,
|
||||
"starttls_enable" bit NOT NULL,
|
||||
"creator" varchar DEFAULT '',
|
||||
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updater" varchar DEFAULT '',
|
||||
|
Loading…
Reference in New Issue
Block a user