ServerProxy.php 1.1 KB
<?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('异常');
        }
    }



}