<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Mikhail<div class=""><br class=""></div><div class="">This is one of those weird inconsistencies between IMAP and SMTP protocols … as far as I remember, the NUL character restriction only applies to the IMAP protocol … so your MTA (e.g. sendmail) is not breaking the SMTP RFC by transferring them.</div><div class="">In my Exim configuration I have some code which strips the NUL characters from externally received messages and prohibits my local users from submitting messages which contain them - you could probably come-up with a similar thing for sendmail.</div><div class="">This may be useful: <a href="http://info-cyrus.andrew.cmu.narkive.com/Rro4Nn9M/554-message-contains-nul-characters" class="">http://info-cyrus.andrew.cmu.narkive.com/Rro4Nn9M/554-message-contains-nul-characters</a><br class=""><div class=""><br class=""></div><div class="">Merlin<br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">--<br class="">Merlin Hartley<br class="">Computer Officer</div><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">MRC Mitochondrial Biology Unit</div><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Cambridge, CB2 0XY</div><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">United Kingdom</div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 24 Jul 2017, at 17:14, Mikhail T. <<a href="mailto:mi+cyrus@aldan.algebra.com" class="">mi+cyrus@aldan.algebra.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
<div bgcolor="#FFFFFF" text="#000000" class="">
<div class="moz-cite-prefix">On 24.07.2017 10:41, Merlin Hartley
wrote:<br class="">
</div>
<blockquote type="cite" cite="mid:CCB6A31B-AFDD-4983-BCBC-D6233ABB3FE4@mrc-mbu.cam.ac.uk" class="">NUL
characters are not permitted in e-mails …
<div class=""><a href="https://helpdesk.pscs.co.uk/690163-Data-stream-contained-NUL-character" class="" moz-do-not-send="true">https://helpdesk.pscs.co.uk/690163-Data-stream-contained-NUL-character</a></div>
<div class=""><br class="">
</div>
<div class="">As the RFC for IMAP states:</div>
<div class=""><a href="https://tools.ietf.org/html/rfc3501#section-9" class="" moz-do-not-send="true">https://tools.ietf.org/html/rfc3501#section-9</a></div>
<div class=""><span style="font-size: 13.3333px; orphans: 2;
widows: 2;" class="">(3) The ASCII NUL character, %x00, MUST
NOT be used at any</span> time.</div>
</blockquote>
But the message did go through sendmail...<br class="">
<br class="">
Ken Murchison wrote:<br class="">
<blockquote type="cite" class="">What is the Content-Transfer-Encoding of the
email? Was the message Base64 encoded, or is the PNG included as
raw binary data? </blockquote>
Raw... Here are the full headers (the first line -- the From_ -- is
removed by <tt class="">sed</tt> before feeding the rest into <tt class="">deliver</tt>):<br class="">
<blockquote class=""><tt class="">From <a class="moz-txt-link-abbreviated" href="mailto:mi@EXAMPLE.com">mi@EXAMPLE.com</a> Mon Jul 24 00:53:00 2017<br class="">
Received: from narawntapu.narawntapu (localhost [127.0.0.1])</tt><tt class=""><br class="">
</tt><tt class=""> by narawntapu.narawntapu (8.15.2/8.15.2) with
ESMTPS id v6O4r05T003160</tt><tt class=""><br class="">
</tt><tt class=""> (version=TLSv1.2
cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO)</tt><tt class=""><br class="">
</tt><tt class=""> for <a class="moz-txt-link-rfc2396E" href="mailto:mi@narawntapu.narawntapu"><mi@narawntapu.narawntapu></a>;
Mon, 24 Jul 2017 00:53:00 -0400 (EDT)</tt><tt class=""><br class="">
</tt><tt class=""> (envelope-from <a class="moz-txt-link-abbreviated" href="mailto:mi@narawntapu.narawntapu">mi@narawntapu.narawntapu</a>)</tt><tt class=""><br class="">
</tt><tt class="">Received: (from mi@localhost)</tt><tt class=""><br class="">
</tt><tt class=""> by narawntapu.narawntapu (8.15.2/8.15.2/Submit)
id v6O4r0c9003159;</tt><tt class=""><br class="">
</tt><tt class=""> Mon, 24 Jul 2017 00:53:00 -0400 (EDT)</tt><tt class=""><br class="">
</tt><tt class=""> (envelope-from mi)</tt><tt class=""><br class="">
</tt><tt class="">Date: Mon, 24 Jul 2017 00:53:00 -0400 (EDT)</tt><tt class=""><br class="">
</tt><tt class="">Message-Id: <a class="moz-txt-link-rfc2396E" href="mailto:201707240453.v6O4r0c9003159@narawntapu.narawntapu"><201707240453.v6O4r0c9003159@narawntapu.narawntapu></a></tt><tt class=""><br class="">
</tt><tt class="">From: Cron Daemon <a class="moz-txt-link-rfc2396E" href="mailto:mi@EXAMPLE.com"><mi@EXAMPLE.com></a></tt><tt class=""><br class="">
</tt><tt class="">To: <a class="moz-txt-link-abbreviated" href="mailto:mi@narawntapu.narawntapu">mi@narawntapu.narawntapu</a></tt><tt class=""><br class="">
</tt><tt class="">Mime-Version: 1.0</tt><tt class=""><br class="">
</tt><tt class="">Content-Type: image/png; charset=binary</tt><tt class=""><br class="">
</tt><tt class="">Content-Transfer-Encoding: 8bit</tt><tt class=""><br class="">
</tt><tt class="">Subject: Cron <mi@narawntapu> cat foo.png</tt><br class="">
</blockquote>
Should sendmail have re-encoded with something other than 8bit? I
don't like doing that, because it increases the filesizes to no
obvious benefit... Thanks!<br class="">
<blockquote class="">-mi<br class="">
</blockquote>
</div>
</div></blockquote></div><br class=""></div></div></body></html>