Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hexbee
Cloudreve
提交
1172765c
C
Cloudreve
项目概览
hexbee
/
Cloudreve
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cloudreve
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1172765c
编写于
5月 11, 2020
作者:
H
HFO4
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Feat: option for using SSL connection in mail queue
上级
58856612
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
11 deletion
+19
-11
assets
assets
+1
-1
models/migration.go
models/migration.go
+1
-0
pkg/conf/version.go
pkg/conf/version.go
+1
-1
pkg/email/init.go
pkg/email/init.go
+10
-8
pkg/email/smtp.go
pkg/email/smtp.go
+6
-1
未找到文件。
assets
@
0e8e26e4
比较
538bd95a
...
0e8e26e4
Subproject commit
538bd95a7ba1712bf8b079375d1aa419d803273
a
Subproject commit
0e8e26e4dee4100dcff1089f83fc34fe165de65
a
models/migration.go
浏览文件 @
1172765c
...
...
@@ -90,6 +90,7 @@ func addDefaultSettings() {
{
Name
:
"replyTo"
,
Value
:
`abslant@126.com`
,
Type
:
"mail"
},
{
Name
:
"smtpUser"
,
Value
:
`no-reply@acg.blue`
,
Type
:
"mail"
},
{
Name
:
"smtpPass"
,
Value
:
``
,
Type
:
"mail"
},
{
Name
:
"smtpEncryption"
,
Value
:
`0`
,
Type
:
"mail"
},
{
Name
:
"maxEditSize"
,
Value
:
`4194304`
,
Type
:
"file_edit"
},
{
Name
:
"archive_timeout"
,
Value
:
`60`
,
Type
:
"timeout"
},
{
Name
:
"download_timeout"
,
Value
:
`60`
,
Type
:
"timeout"
},
...
...
pkg/conf/version.go
浏览文件 @
1172765c
...
...
@@ -4,7 +4,7 @@ package conf
var
BackendVersion
=
"3.0.0-beta1"
// RequiredDBVersion 与当前版本匹配的数据库版本
var
RequiredDBVersion
=
"3.0.0"
var
RequiredDBVersion
=
"3.0.0
-33-g5885661
"
// RequiredStaticVersion 与当前版本匹配的静态资源版本
var
RequiredStaticVersion
=
"3.0.0"
...
...
pkg/email/init.go
浏览文件 @
1172765c
...
...
@@ -30,19 +30,21 @@ func Init() {
"replyTo"
,
"smtpUser"
,
"smtpPass"
,
"smtpEncryption"
,
)
port
:=
model
.
GetIntSetting
(
"smtpPort"
,
25
)
keepAlive
:=
model
.
GetIntSetting
(
"mail_keepalive"
,
30
)
client
:=
NewSMTPClient
(
SMTPConfig
{
Name
:
options
[
"fromName"
],
Address
:
options
[
"fromAdress"
],
ReplyTo
:
options
[
"replyTo"
],
Host
:
options
[
"smtpHost"
],
Port
:
port
,
User
:
options
[
"smtpUser"
],
Password
:
options
[
"smtpPass"
],
Keepalive
:
keepAlive
,
Name
:
options
[
"fromName"
],
Address
:
options
[
"fromAdress"
],
ReplyTo
:
options
[
"replyTo"
],
Host
:
options
[
"smtpHost"
],
Port
:
port
,
User
:
options
[
"smtpUser"
],
Password
:
options
[
"smtpPass"
],
Keepalive
:
keepAlive
,
Encryption
:
model
.
IsTrueVal
(
options
[
"smtpEncryption"
]),
})
Client
=
client
...
...
pkg/email/smtp.go
浏览文件 @
1172765c
...
...
@@ -22,7 +22,7 @@ type SMTPConfig struct {
Port
int
// 服务器端口
User
string
// 用户名
Password
string
// 密码
Encryption
string
// 是否启用加密
Encryption
bool
// 是否启用加密
Keepalive
int
// SMTP 连接保留时长
}
...
...
@@ -77,6 +77,11 @@ func (client *SMTP) Init() {
d
.
Timeout
=
time
.
Duration
(
client
.
Config
.
Keepalive
+
5
)
*
time
.
Second
client
.
chOpen
=
true
// 是否启用 SSL
if
client
.
Config
.
Encryption
{
d
.
SSL
=
true
}
var
s
mail
.
SendCloser
var
err
error
open
:=
false
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录