我在线阅读了很多论坛帖子,说我需要设置$mime_drivers [‘html’] [‘inline’] = true;在mime_drivers.PHP中.但是,如果我改变这个文件,恐怕cPanel会覆盖它. cPanel倾向于覆盖我修改的文件.
解决方法
$mime_drivers['imp']['html'] = array( 'inline' => false,
至:
$mime_drivers['imp']['html'] = array( 'inline' => true,
我担心,每次cPanel更新部落时,这种变化都会丢失,我的用户会抱怨.现在,我相信我找到了解决方案. (但是Horde还没有更新,所以我无法确定这是否有效).
在包含imp / config / mime_drivers.PHP后,Horde将检查目录imp / config / mime_drivers.d /,如果找到,将包含()该目录中以.PHP结尾的所有文件.此目录在cPanel下不存在,因此可以创建它而不必担心被覆盖.
文件/usr/local / cpanel / src / 3rdparty / gpl / README-horde包含有关cPanel如何更新Horde的详细信息,以及有关定制部落的说明.该文件的一些相关例外提供了关于如何永久地进行我想要的自定义的线索:
During the maintenance phase of /scripts/upcp and
/scripts/maintenance,the webmail script found at
/usr/local/cpanel/install/webmail is executed. This in turn executes
/usr/local/cpanel/bin/update-horde. Presented below is an outline of
steps update-horde performs:
- The Horde installation is wiped clean (rm -rf /usr/local/cpanel/base/horde).
- Using the version specified in update-horde,the appropriate Horde source tarball will be extracted to /usr/local/cpanel/base.
[…]
After determining which tarball to use for the source install,and
extracting it,the update-horde script checks for the following:06002
As with the prior tarballs,the value of $hordever must match what is defined in the update-horde script. The overlay tarball
provides a simple way of customizing specific aspects of Horde. For
example,certain graphics,themes,modules,plugins and the like can
all be provided as an overlay. Since it is extracted into
/usr/local/cpanel/base,the contents of the tarball must match the
directory layout found in /usr/local/cpanel/base/horde.
从这个文件我能够发现以下步骤来覆盖内联HTML视图设置如下:
tl; dr:这是步骤:
>在临时目录中,创建cPanel期望的horde / imp / config / mime_drivers.d /目录结构:
mkdir -p /tmp/horde/imp/config/mime_drivers.d
>在该新目录中创建覆盖文件.我将我的名字命名为html.PHP,但只要它以.PHP结尾就可以命名
>将以下内容插入/tmp/horde/imp/config/mime_drivers.d/html.PHP:
<?PHP /** * HTML driver settings */ $mime_drivers['imp']['html'] = array( 'inline' => true,'handles' => array( 'text/html' ),'icons' => array( 'default' => 'html.png' ),/* If you don't want to display the link to open the HTML content in a * separate window,set the following to false. */ 'external' => true,/* Run 'tidy' on all HTML output? This requires at least version 2.0 of the * PECL 'tidy' extension to be installed on your system. */ 'tidy' => false,/* Check for phishing exploits? */ 'phishing_check' => true );
>在/var/cpanel/horde/overlay.tar.gz创建/ tmp / horde目录的.tar.gz版本:
cd /tmp tar -czvf /var/cpanel/horde/overlay.tar.gz horde
每次更新部落时,都应通过cPanel扩展此文件,重新添加配置覆盖.
>将/tmp/horde/imp/config/mime_drivers.d/移动到位:
mv /tmp/horde/imp/config/mime_drivers.d /usr/local/cpanel/base/horde/imp/config/
>登录部落进行测试.