ServerProxy.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
namespace Controller;
use Lib\Mail\Mail;
use Lib\Mail\MailFun;
use Lib\UploadFile;
use Lib\Verify;
use Model\bodySql;
use Model\emailSql;
use Model\folderSql;
use Model\listsSql;
use Model\sendJobsSql;
use Service\MailProxy;
use Service\SyncMail;
/**
* 读取代理服务器配置
* @author:dc
* @time 2025/3/10 16:36
* Class ServerProxy
* @package Controller
*/
class ServerProxy extends Base {
/**
* shopk和mail-server都必须使用这个 进行分配
* @return array[]
* @author:dc
* @time 2025/3/10 16:39
*/
public function index(){
$email = app()->request('email');
$smtp = app()->request('smtp');
$imap = app()->request('imap');
$default = app()->request('default');
if($email&&$imap&&$smtp&&Verify::sEmail($email)){
$proxy = new MailProxy($email,$imap,$smtp, $default);
$proxy->proxySuccess();
app()->_json([
'imap_proxy' => $proxy->getImapProxy(),
'smtp_proxy' => $proxy->getSmtpProxy()
]);
}else{
app()->e('异常');
}
}
}