如何在cPanel下配置Horde来显示HTML电子邮件?

前端之家收集整理的这篇文章主要介绍了如何在cPanel下配置Horde来显示HTML电子邮件?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在cPanel中,Horde默认不显示富文本/ HTML电子邮件,它只显示纯文本版本.我知道有一个显示HTML电子邮件的选项,但我不知道如何在cPanel下启用它.

我在线阅读了很多论坛帖子,说我需要设置$mime_drivers [‘html’] [‘inline’] = true;在mime_drivers.PHP中.但是,如果我改变这个文件,恐怕cPanel会覆盖它. cPanel倾向于覆盖我修改文件.

如何在cPanel下配置Horde来显示HTML电子邮件

解决方法

这个问题困扰了我很久了.几个月前我无法找到答案,所以我刚刚编辑了/usr/local/cpanel/base/horde/imp/config/mime_drivers.PHP,专门更改了部分:
$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:

  1. The Horde installation is wiped clean (rm -rf /usr/local/cpanel/base/horde).
  2. 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/

>登录部落进行测试.

猜你在找的HTML相关文章