diff --git a/build/cpanel.php b/build/cpanel.php index 2718b75aa..d8280d9e4 100755 --- a/build/cpanel.php +++ b/build/cpanel.php @@ -21,9 +21,8 @@ foreach ($files as $file) { } $cpanel_tar->addFile('.htaccess', "{$cpanel_path}.htaccess"); -//$cpanel_tar->addFile('_include.php', 'snappymail/app/_include.php'); $cpanel_tar->addFile('README.md', "{$cpanel_path}README.md"); -$cpanel_tar->addFromString('VERSION', $package->version); +$cpanel_tar->addFromString("{$cpanel_path}VERSION", $package->version); $index = file_get_contents('index.php'); $index = str_replace('0.0.0', $package->version, $index); diff --git a/integrations/cpanel/usr/local/cpanel/base/3rdparty/snappymail/include.php b/integrations/cpanel/usr/local/cpanel/base/3rdparty/snappymail/include.php new file mode 100644 index 000000000..0135d1f8d --- /dev/null +++ b/integrations/cpanel/usr/local/cpanel/base/3rdparty/snappymail/include.php @@ -0,0 +1,37 @@ +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->Set('cache', 'path', $_ENV['TMPDIR'] . '/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 f1577d535..00acfa5c7 100644 --- a/snappymail/v/0.0.0/include.php +++ b/snappymail/v/0.0.0/include.php @@ -70,13 +70,7 @@ define('APP_PRIVATE_DATA_NAME', $sPrivateDataFolderInternalName ?: '_default_'); unset($sPrivateDataFolderInternalName); if (!defined('APP_DATA_FOLDER_PATH')) { - // cPanel https://github.com/the-djmaze/snappymail/issues/697 - 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; - } + $sCustomDataPath = rtrim(trim(function_exists('__get_custom_data_full_path') ? __get_custom_data_full_path() : $sCustomDataPath), '\\/'); define('APP_DATA_FOLDER_PATH', strlen($sCustomDataPath) ? $sCustomDataPath.'/' : APP_INDEX_ROOT_PATH.'data/'); } unset($sCustomDataPath);