perl - OTRS PostmasterMailbox.pl 解析/MIME 类型

标签 perl ubuntu encoding mime otrs

从 Ubuntu Server 12.04 升级到 Ubuntu 14.04 LTS 后,我开始遇到解析问题 与我的 otrs 安装。 我正在使用 mysql 5.5 和 perl 5.18 运行 OTRS 3.1.1。 我认为这可能是因为我有一个旧的 OTRS 版本,所以按照 OTRS手册决定升级到OTRS 3.2.1,mysql 5.6并将几乎所有perl模块+apache升级到2.4.7

我这样做了,一切正常,但解析问题仍然存在。 OTRS 通过 cronjob 使用脚本从邮箱中获取电子邮件并创建票证。 对于许多票证,它无法解析它们,导致系统卡在特定邮件上 并连续打开同一张票然后死亡(不解析队列中的其他邮件)。

有什么想法吗?

    # /opt/otrs/bin/otrs.PostMasterMailbox.pl -f 1
    Useless use of '\'; doesn't escape metacharacter '{' at /opt/otrs/Kernel/System/VariableCheck.pm line 290.
    In '(?...)', splitting the initial '(?' is deprecated in regex; marked by <-- HERE in m/
            (                                          # $1 greater-than and less-than sign
                > | < | \s+ | \#{6} |
                (?: &[a-zA-Z0-9]+; )                   # get html entities
            )
            (                                          # $2
                (?:                                    # http or only www
                    (?: (?: http s? | ftp ) :\/\/) |   # http://,https:// and ftp://
                    (?: (?: www | ftp ) \.)            # www. and ftp.
                )
            )
            (                                          # $3
                (?: [a-z0-9\-]+ \. )*                  # get subdomains, optional
                [a-z0-9\-]+                            # get top level domain
                (?:                                    # file path element
                    [\/\.]
                    | [a-zA-Z0-9\-]
                )*
                (?:                                    # param string
                    [\?]                               # if param string is there, "?" must be present
                    [a-zA-Z0-9&;=%]*                   # param string content, this will also catch entities like &amp;
                )?
                (?:                                    # link hash string
                    [\#]                               #
                    [a-zA-Z0-9&;=%]*                   # hash string content, this will also catch entities like &amp;
                )?
            )
            (                                          # $4
                ? <-- HERE =(?:
                    [\?,;!\.\)] (?: \s | $ )           # \)\s this construct is because of bug# 2450
                    | \"
                    | \]
                    | \s+
                    | '
                    | >                               # greater-than and less-than sign
                    | <                               # "
                    | (?: &[a-zA-Z0-9]+; )+            # html entities
                    | $                                # bug# 2715
                )
                | \#{6}                                # ending LinkHash
            )
        / at /opt/otrs/Kernel/System/HTMLUtils.pm line 867.

IMAP: Connection to mailserver closed.

IMAP: Connection to mailserver closed.

IMAP: Connection to mailserver closed.

IMAP: Connection to mailserver  closed.

IMAP: Connection to mailserver  closed.

IMAP: Message 1/5 (account/mailserver )
No valid 'utf-8' string: ' ....

...

open body: Invalid argument at /opt/otrs/Kernel/cpan-lib/MIME/Entity.pm line 1872.

编辑: 检查了 apache 日志,我得到了很多重新定义,如下所示:

[Sat Jun 21 19:44:20 2014] GeneralCatalog.pm: Subroutine ItemAdd redefined at /opt/otrs/Kernel/System/GeneralCatalog.pm line 461.
[Sat Jun 21 19:44:20 2014] GeneralCatalog.pm: Subroutine ItemUpdate redefined at /opt/otrs/Kernel/System/GeneralCatalog.pm line 569.
[Sat Jun 21 19:44:20 2014] GeneralCatalog.pm: Subroutine GeneralCatalogPreferencesSet redefined at /opt/otrs/Kernel/System/GeneralCatalog.pm line 678.
[Sat Jun 21 19:44:20 2014] GeneralCatalog.pm: Subroutine GeneralCatalogPreferencesGet redefined at /opt/otrs/Kernel/System/GeneralCatalog.pm line 697.
[Sat Jun 21 19:44:20 2014] LayoutImportExport.pm: Subroutine ImportExportFormInputCreate redefined at /opt/otrs//Kernel/Output/HTML/LayoutImportExport.pm line 31.
[Sat Jun 21 19:44:20 2014] LayoutImportExport.pm: Subroutine ImportExportFormDataGet redefined at /opt/otrs//Kernel/Output/HTML/LayoutImportExport.pm line 66.
[Sat Jun 21 19:44:20 2014] LayoutImportExport.pm: Subroutine _ImportExportLoadLayoutBackend redefined at /opt/otrs//Kernel/Output/HTML/LayoutImportExport.pm line 100.
[Sat Jun 21 19:44:20 2014] PreferencesDB.pm: Subroutine new redefined at /opt/otrs//Kernel/System/GeneralCatalog/PreferencesDB.pm line 72.
[Sat Jun 21 19:44:20 2014] PreferencesDB.pm: Subroutine GeneralCatalogPreferencesSet redefined at /opt/otrs//Kernel/System/GeneralCatalog/PreferencesDB.pm line 105.
[Sat Jun 21 19:44:20 2014] PreferencesDB.pm: Subroutine GeneralCatalogPreferencesGet redefined at /opt/otrs//Kernel/System/GeneralCatalog/PreferencesDB.pm line 152.

最佳答案

您发布了一长串错误消息,主要是 Perl 5.18 中正则表达式功能的折旧警告。

实际问题是这样的:

open body: Invalid argument at /opt/otrs/Kernel/cpan-lib/MIME/Entity.pm line 1872.

该问题也是由 Perl 5.18 中的更改引起的,并在 OTRS 3.2.12 中修复。您应该将 3.2.1 升级到最新的补丁版本 3.2.x。 http://bugs.otrs.org/show_bug.cgi?id=9832

编辑:它也已在 3.3.1 中修复,因此如果您升级到最新的 3.3.x 补丁级别版本(即此时的 3.3.8),您也可以!

顺便说一句,在更高的 3.2.x 版本中,正则表达式折旧警告也消失了!

关于perl - OTRS PostmasterMailbox.pl 解析/MIME 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24344004/

相关文章:

xml - 在以 XML 模式使用 Mojo::DOM 的 Perl 中,如何匹配子标签的内容?

perl - 如何在 IMAP 邮件主题中搜索非 ASCII 文本

ubuntu - NGINX安装错误

python - cron 作业没有将输出写入正确的输出日志文件

ruby - 获取字符串的含义

forms - 何时何地对用户输入进行编码?

regex - 使用 Perl 匹配一些行并删除它们

perl - 如何在 Perl 中的 printf 函数中集中对齐

Ruby:gem 安装在错误的目录中

c - GTK+ 2.24。如何在C中使用unicode符号