diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index 1c4432568..d9913e934 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -509,7 +509,10 @@ class Actions switch (true) { default: case $bForceFile: - $oDriver = new \MailSo\Cache\Drivers\File(APP_PRIVATE_DATA . 'cache', $sKey); + $oDriver = new \MailSo\Cache\Drivers\File( + \trim($this->oConfig->Get('cache', 'path', APP_PRIVATE_DATA . 'cache')), + $sKey + ); break; case ('APCU' === $sDriver) && @@ -566,8 +569,8 @@ class Actions if ($this->oConfig->Get('logs', 'auth_logging', false)) { // $this->oLoggerAuth->SetLevel(\LOG_WARNING); - $sAuthLogFileFullPath = \APP_PRIVATE_DATA . 'logs/' . $this->compileLogFileName( - $this->oConfig->Get('logs', 'auth_logging_filename', '')); + $sAuthLogFileFullPath = \trim($this->oConfig->Get('logs', 'path', \APP_PRIVATE_DATA . 'logs')) + . '/' . $this->compileLogFileName($this->oConfig->Get('logs', 'auth_logging_filename', '')); $sLogFileDir = \dirname($sAuthLogFileFullPath); if (!\is_dir($sLogFileDir)) { \mkdir($sLogFileDir, 0755, true); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php index 503e14e44..4967825c1 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -283,6 +283,8 @@ Values: 'enable' => array(false, 'Enable logging'), + 'path' => array('', 'Path where log files will be stored'), + 'level' => array(4, 'Log messages of set RFC 5424 section 6.2.1 Severity level and higher (0 = highest, 7 = lowest). 0 = Emergency 1 = Alert @@ -343,6 +345,8 @@ Examples: Enables caching in the system'), + 'path' => array('', 'Path where cache files will be stored'), + 'index' => array('v1', 'Additional caching key. If changed, cache is purged'), 'fast_cache_driver' => array('files', 'Can be: files, APCU, memcache, redis (beta)'), diff --git a/snappymail/v/0.0.0/cpanel.php b/snappymail/v/0.0.0/cpanel.php index fb1e63cda..dabb72ff9 100644 --- a/snappymail/v/0.0.0/cpanel.php +++ b/snappymail/v/0.0.0/cpanel.php @@ -13,6 +13,8 @@ if (defined('APP_PLUGINS_PATH') && !empty($_ENV['CPANEL']) && !is_dir(APP_PLUGIN $oConfig->Set('plugins', 'enable', true); $oConfig->Set('plugins', 'enabled_list', \implode(',', \array_unique($aList))); $oConfig->Set('login', 'default_domain', 'cpanel'); + $oConfig->Set('logs', 'path', $_ENV['HOME'] . '/logs/snappymail'); + $oConfig->Set('cache', 'path', $_ENV['HOME'] . '/tmp/snappymail'); $oConfig->Save(); $sFile = APP_PRIVATE_DATA.'domains/cpanel.json'; diff --git a/snappymail/v/0.0.0/include.php b/snappymail/v/0.0.0/include.php index d655c23e7..f1577d535 100644 --- a/snappymail/v/0.0.0/include.php +++ b/snappymail/v/0.0.0/include.php @@ -55,8 +55,7 @@ date_default_timezone_set('UTC'); $sCustomDataPath = ''; $sCustomConfiguration = ''; -if (is_file(APP_INDEX_ROOT_PATH.'include.php')) -{ +if (is_file(APP_INDEX_ROOT_PATH.'include.php')) { include_once APP_INDEX_ROOT_PATH.'include.php'; } @@ -72,8 +71,9 @@ unset($sPrivateDataFolderInternalName); if (!defined('APP_DATA_FOLDER_PATH')) { // cPanel https://github.com/the-djmaze/snappymail/issues/697 - if (!empty($_ENV['CPANEL']) && isset($_ENV['TMPDIR'])) { - $sCustomDataPath = $_ENV['TMPDIR'] . '/snappymail'; + if (!empty($_ENV['CPANEL']) && isset($_ENV['HOME'])) { + $sCustomDataPath = $_ENV['HOME'] . '/var/snappymail'; +// $sCustomDataPath = $_ENV['TMPDIR'] . '/snappymail'; } else { $sCustomDataPath = function_exists('__get_custom_data_full_path') ? rtrim(trim(__get_custom_data_full_path()), '\\/') : $sCustomDataPath; }