/** * @return string */ public static function SetupDefaultMailSoConfig() { if (\class_exists('MailSo\\Config')) { if (\RainLoop\Api::Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) && \MailSo\Base\Utils::IsMbStringSupported() && \MailSo\Config::$MBSTRING) { \MailSo\Config::$ICONV = false; } \MailSo\Config::$MessageListFastSimpleSearch = !!\RainLoop\Api::Config()->Get('labs', 'imap_message_list_fast_simple_search', true); \MailSo\Config::$MessageListCountLimitTrigger = (int) \RainLoop\Api::Config()->Get('labs', 'imap_message_list_count_limit_trigger', 0); \MailSo\Config::$MessageListDateFilter = (int) \RainLoop\Api::Config()->Get('labs', 'imap_message_list_date_filter', 0); \MailSo\Config::$MessageListPermanentFilter = \trim(\RainLoop\Api::Config()->Get('labs', 'imap_message_list_permanent_filter', '')); \MailSo\Config::$MessageAllHeaders = !!\RainLoop\Api::Config()->Get('labs', 'imap_message_all_headers', false); \MailSo\Config::$LargeThreadLimit = (int) \RainLoop\Api::Config()->Get('labs', 'imap_large_thread_limit', 50); \MailSo\Config::$BoundaryPrefix = '_RainLoop_'; \MailSo\Config::$SystemLogger = \RainLoop\Api::Logger(); $sSslCafile = \RainLoop\Api::Config()->Get('ssl', 'cafile', ''); $sSslCapath = \RainLoop\Api::Config()->Get('ssl', 'capath', ''); if (!empty($sSslCafile) || !empty($sSslCapath)) { \MailSo\Hooks::Add('Net.NetClient.StreamContextSettings/Filter', function (&$aStreamContextSettings) use($sSslCafile, $sSslCapath) { if (isset($aStreamContextSettings['ssl']) && \is_array($aStreamContextSettings['ssl'])) { if (empty($aStreamContextSettings['ssl']['cafile']) && !empty($sSslCafile)) { $aStreamContextSettings['ssl']['cafile'] = $sSslCafile; } if (empty($aStreamContextSettings['ssl']['capath']) && !empty($sSslCapath)) { $aStreamContextSettings['ssl']['capath'] = $sSslCapath; } } }); } } }
/** * @return void */ protected function __construct() { $this->oModuleManager = \CApi::GetModuleManager(); // \MailSo\Config::$FixIconvByMbstring = false; \MailSo\Config::$SystemLogger = \CApi::MailSoLogger(); \MailSo\Config::$PreferStartTlsIfAutoDetect = !!\CApi::GetConf('labs.prefer-starttls', true); }
/** * @return void */ protected function __construct() { $this->oHttp = \MailSo\Base\Http::NewInstance(); $this->oActions = Actions::NewInstance(); $this->oActions->SetHttp($this->oHttp); $this->oTwilio = $this->oActions->GetTwilio(); \CApi::Plugin()->SetActions($this->oActions); // \MailSo\Config::$FixIconvByMbstring = false; \MailSo\Config::$SystemLogger = \CApi::MailSoLogger(); }
/** * @return void */ protected function __construct() { $this->oHttp = \MailSo\Base\Http::NewInstance(); $this->oActions = Actions::NewInstance(); $this->oActions->SetHttp($this->oHttp); $this->oTwilio = $this->oActions->GetTwilio(); \CApi::Plugin()->SetActions($this->oActions); // \MailSo\Config::$FixIconvByMbstring = false; \MailSo\Config::$SystemLogger = \CApi::MailSoLogger(); \MailSo\Config::$PreferStartTlsIfAutoDetect = !!\CApi::GetConf('labs.prefer-starttls', true); }
/** * @return string */ public static function SetupDefaultMailSoConfig() { if (\class_exists('MailSo\\Config')) { if (\RainLoop\Api::Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) && \MailSo\Base\Utils::IsMbStringSupported() && \MailSo\Config::$MBSTRING) { \MailSo\Config::$ICONV = false; } \MailSo\Config::$MessageListFastSimpleSearch = !!\RainLoop\Api::Config()->Get('labs', 'imap_message_list_fast_simple_search', true); \MailSo\Config::$MessageListCountLimitTrigger = (int) \RainLoop\Api::Config()->Get('labs', 'imap_message_list_count_limit_trigger', 0); \MailSo\Config::$MessageListDateFilter = (int) \RainLoop\Api::Config()->Get('labs', 'imap_message_list_date_filter', 0); \MailSo\Config::$MessageListUndeletedFilter = !!\RainLoop\Api::Config()->Get('labs', 'imap_message_list_hide_deleted_messages', true); \MailSo\Config::$SystemLogger = \RainLoop\Api::Logger(); } }
/** * @return bool */ public static function Handle() { static $bOne = null; if ($bOne) { return true; } if (!\class_exists('MailSo\\Version')) { return false; } if (self::Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) && \class_exists('MailSo\\Capa') && \MailSo\Base\Utils::IsMbStringSupported()) { \MailSo\Config::$ICONV = false; } $bOne = true; return true; }
/** * @return void */ private function __construct() { $this->oHttp = \MailSo\Base\Http::SingletonInstance(); $this->oActions = Actions::NewInstance(); \set_error_handler(array(&$this, 'LogPhpErrorHandler')); $this->oServiceActions = new \RainLoop\ServiceActions($this->oHttp, $this->oActions); if ($this->oActions->Config()->Get('debug', 'enable', false)) { \error_reporting(E_ALL); \ini_set('display_errors', 1); } if ($this->oActions->Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) && \class_exists('MailSo\\Capa') && \MailSo\Base\Utils::IsMbStringSupported()) { \MailSo\Config::$ICONV = false; } $sServer = \trim($this->oActions->Config()->Get('security', 'custom_server_signature', '')); if (0 < \strlen($sServer)) { @\header('Server: ' . $sServer, true); } if ($this->oActions->Config()->Get('labs', 'force_https', false) && !$this->oHttp->IsSecure()) { @\header('Location: https://' . $this->oHttp->GetHost(false, false) . $this->oHttp->GetUrl(), true); exit; } }