请求跟踪器 4 html 邮件内联图像不可见

请求跟踪器 4 html 邮件内联图像不可见

我正在使用 Request Tracker 4.0.15。

我的安装使用 getmail 将 html 电子邮件附加(或创建)到票证,但是内嵌图像不可见:

<div dir="ltr">

<div>text text text text text

    <br><br><img><br><br>

</div>text text text text text text<br>

但是,当我从 RT4 票务页面下载电子邮件并打开它时,图像是可见的:

<div dir="ltr">

<div>text text text text text

    <br><br><img alt="Inline images 1" src="<<removed>>"><br><br>

</div>text text text text text text<br>

我的配置:

Set($TrustHTMLAttachments, 1);
Set($AlwaysDownloadAttachments, 1);
Set($PreferRichText, 1);
Set($ShowTransactionImages, 1);

我还创建了一个 Web_local.pm,内容如下:

push @SCRUBBER_ALLOWED_TAGS, qw(A B U P BR I HR BR SMALL EM FONT SPAN STRONG SUB SUP STRIKE H1 H2 H3 H4 H5
H6 DIV UL OL LI DL DT DD PRE BLOCKQUOTE BDO IMG);

push %SCRUBBER_ALLOWED_ATTRIBUTES = (
# Match http, https, ftp, mailto and relative urls
# XXX: we also scrub format strings with this module then allow simple config options
href   => qr{^(?:https?:|ftp:|mailto:|/|__Web(?:Path|BaseURL|URL)__)}i,
face   => 1,
size   => 1,
target => 1,
src    => 1,
style  => qr{
    ^(?:\s*
        (?:(?:background-)?color: \s*
                (?:rgb\(\s* \d+, \s* \d+, \s* \d+ \s*\) |   # rgb(d,d,d)
                   \#[a-f0-9]{3,6}                      |   # #fff or #ffffff
                   [\w\-]+                                  # green, light-blue, etc.
                   )                            |
           text-align: \s* \w+                  |
           font-size: \s* [\w.\-]+              |
           font-family: \s* [\w\s"',.\-]+       |
           font-weight: \s* [\w\-]+             |

           # MS Office styles, which are probably fine.  If we don't, then any
           # associated styles in the same attribute get stripped.
           mso-[\w\-]+?: \s* [\w\s"',.\-]+
        )\s* ;? \s*)
     +$ # one or more of these allowed properties from here 'till sunset
}ix,
dir    => qr/^(rtl|ltr)$/i,
lang   => qr/^\w+(-\w+)?$/,
);

答案1

您需要允许该alt属性%SCRUBBER_ALLOWED_ATTRIBUTES

相关内容