切换导航条
此项目
正在载入...
登录
周海龙
/
mail-serve
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
邓超
6 months ago
提交
1ffc18add125022bbea42b1eac65023f4280e272
1 个父辈
46c01d76
x
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
24 行增加
和
10 行删除
event/MailBlack.php
lib/Mail/Mail.php
event/MailBlack.php
查看文件 @
1ffc18a
...
...
@@ -41,12 +41,31 @@ class MailBlack {
$this
->
blackFolder
=
$this
->
db
->
cache
(
3600
)
->
value
(
folderSql
::
originFolder
(
$data
[
'email_id'
],
'垃圾箱'
));
}
$this
->
check
();
}
protected
function
check
(){
// 验证是否存在黑名单中
if
(
$this
->
blacklist
&&
$this
->
blackFolder
!=
$folder
){
// 邮箱是否在黑名单中
$isBlacklist
=
false
;
if
(
!
empty
(
$blacklist
[
'emails'
])
&&
is_array
(
$blacklist
[
'emails'
])
&&
in_array
(
$this
->
data
[
'from'
],
$blacklist
[
'emails'
])){
$isBlacklist
=
true
;
}
// 域是否存在
if
(
!
empty
(
$blacklist
[
'domain'
])
&&
is_array
(
$blacklist
[
'domain'
])
&&
in_array
(
explode
(
'@'
,
$this
->
data
[
'from'
])[
1
],
$blacklist
[
'domain'
])){
$isBlacklist
=
true
;
}
if
(
$isBlacklist
&&
$this
->
blackFolder
){
// 移入垃圾箱
$this
->
client
->
move
([
$this
->
data
[
'uid'
]],
$this
->
blackFolder
);
}
}
}
}
\ No newline at end of file
...
...
lib/Mail/Mail.php
查看文件 @
1ffc18a
...
...
@@ -2,6 +2,7 @@
namespace
Lib\Mail
;
use
Event\Event
;
use
Event\syncMail
;
use
Lib\DbPool
;
use
Model\bodySql
;
...
...
@@ -287,7 +288,7 @@ class Mail {
unset
(
$uids
[
$k
]);
}
}
$msgno
+=
$nu
;
...
...
@@ -442,13 +443,7 @@ class Mail {
try
{
$id
=
$db
->
throw
()
->
insert
(
listsSql
::
$table
,
$data
);
if
(
$id
){
if
(
php_sapi_name
()
==
'cli'
){
go
(
function
(
$id
,
$header
,
$data
){
new
syncMail
(
$id
,
$header
,
$data
);
},
...
[
$id
,
$header
,
$data
]
);
}
Event
::
call
(
SyncMail
::
class
,
$id
,
$data
);
}
}
catch
(
\Throwable
$e
){
...
...
请
注册
或
登录
后发表评论