<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi all.
<p>I continue the years old thread related to improper processing of
Unicode strings either in Mimedefang or Perl libs. Last message <a
class="moz-txt-link-freetext"
href="https://lists.roaringpenguin.com/pipermail/mimedefang/2017-December/038247.html">https://lists.roaringpenguin.com/pipermail/mimedefang/2017-December/038247.html</a></p>
<p>As far as I can see, the exception happens only when Mimedefang
tries to remove an attachment with non-ASCII (e.g, Russian) name.
If attachment is permitted and passed, exception does not appear.
Looks like also, that other Russian names in same message do not
generate an exception; not sure in exception logging scheme.
Please note also that about 50% of attachments in our environment
have Cyrillic names in UTF-8, but the issue happens few times a
year only.<br>
</p>
<p>The example log ("use diagnostics;" in mimedefang.pl) is below.</p>
<p>The visible names of attachments are: "Ат. профессора.rar", "ВАК
дмн.rar", "Диплом БДМУ 1982.rar" and "Категория 2016.rar".</p>
<p>The MIME headers for first attachment are:</p>
<pre>Content-Type: application/octet-stream;
name="=?UTF-8?B?0JDRgi4g0L/RgNC+0YTQtdGB0YHQvtGA0LAucmFy?="
Content-Disposition: attachment; filename="=?UTF-8?B?0JDRgi4g0L/RgNC+0YTQtdGB0YHQvtGA0LA=?=
=?UTF-8?B?LnJhcg==?="
Content-Transfer-Encoding: base64
X-Attachment-Id: f_jimx17ff8</pre>
<p>Debian Jessie, Mimedefang 2.83 built from source, no embedded
Perl mode, Mime-Tools 5.009, Perl v5.20.2.<br>
</p>
<p>Yes, I have the whole message and I can provide any other
non-confidential details from it.<br>
</p>
<p>====<br>
</p>
<p>Jun 20 18:26:52 mail mimedefang.pl[25718]: C6CE82122B:
MDLOG,C6CE82122B,bad_filename,%410%442.
%43F%440%43E%444%435%441%441%43E%440%430.rar,application/octet-stream,<a
class="moz-txt-link-rfc2396E" href="mailto:x@gmail.com"><x@gmail.com></a>,<a
class="moz-txt-link-rfc2396E" href="mailto:x@my.com"><x@my.com></a>,Re:
LEC<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: Strings with code points over 0xFF may not be
mapped into in-memory file<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: handles (#1)<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: (W utf8) You tried to open a reference to a
scalar for read or append<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: where the scalar contained code points over
0xFF. In-memory files<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: model on-disk files and can only contain
bytes.<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr:<br>
Jun 20 18:26:52 mail mimedefang.pl[25718]: C6CE82122B:
MDLOG,C6CE82122B,bad_filename,%412%410%41A
%434%43C%43D.rar,application/octet-stream,<a
class="moz-txt-link-rfc2396E" href="mailto:x@gmail.com"><x@gmail.com></a>,<a
class="moz-txt-link-rfc2396E" href="mailto:x@my.com"><x@my.com></a>,Re:
LEC<br>
Jun 20 18:26:52 mail mimedefang.pl[25718]: C6CE82122B:
MDLOG,C6CE82122B,bad_filename,%414%438%43F%43B%43E%43C
%411%414%41C%423 1982.rar,application/octet-stream,<a
class="moz-txt-link-rfc2396E" href="mailto:x@gmail.com"><x@gmail.com></a>,<a
class="moz-txt-link-rfc2396E" href="mailto:x@my.com"><x@my.com></a>,Re:
LEC<br>
Jun 20 18:26:52 mail mimedefang.pl[25718]: C6CE82122B:
MDLOG,C6CE82122B,bad_filename,%41A%430%442%435%433%43E%440%438%44F
2016.rar,application/octet-stream,<a class="moz-txt-link-rfc2396E"
href="mailto:x@gmail.com"><x@gmail.com></a>,<a
class="moz-txt-link-rfc2396E" href="mailto:x@my.com"><x@my.com></a>,Re:
LEC<br>
Jun 20 18:26:52 mail mimedefang.pl[25718]: C6CE82122B:
MDLOG,C6CE82122B,mail_in,,,<a class="moz-txt-link-rfc2396E"
href="mailto:x@gmail.com"><x@gmail.com></a>,<a
class="moz-txt-link-rfc2396E" href="mailto:x@my.com"><x@my.com></a>,Re:
LEC<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: Uncaught exception from user code:<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: open body: Invalid argument at
/usr/share/perl5/MIME/Entity.pm line 1892.<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr:
MIME::Entity::print_bodyhandle(MIME::Entity=HASH(0xa10a63c),
GLOB(0x9b07fe8)) called at /usr/share/perl5/MIME/Entity.pm line
1873<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr:
MIME::Entity::print_body(MIME::Entity=HASH(0xa10a63c),
GLOB(0x9b07fe8)) called at /usr/share/perl5/MIME/Entity.pm line
1785<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr:
MIME::Entity::print(MIME::Entity=HASH(0xa10a63c), GLOB(0x9b07fe8))
called at /usr/share/perl5/MIME/Entity.pm line 1846<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: MIME::Entity::print_body<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: (MIME::Entity=HASH(0xa106420), GLOB(0x9b07fe8))
called at /usr/local/bin/mimedefang.pl line 6160<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr:
main::do_scan("/var/spool/MIMEDefang/mdefang-W13qP1p") called at
/usr/local/bin/mimedefang.pl line 5663<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: main::handle_scan("C6CE82122B",
"/var/spool/MIMEDefang/mdefang-W13qP1p") called at
/usr/local/bin/mimedefang.pl line 5600<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: main::do_main_loop() called at
/usr/local/bin/mimedefang.pl line 5426<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: C6CE82122B:
Worker 0 stderr: main::main called at
/usr/local/bin/mimedefang.pl line 7521<br>
Jun 20 18:26:52 mail mimedefang-multiplexor[25717]: Worker 0 died
prematurely -- check your filter rules<br>
</p>
========<br>
</body>
</html>