<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Email on Tony Andrew Meyer</title><link>http://tonyandrewmeyer.com/tags/email/</link><description>Recent content in Email on Tony Andrew Meyer</description><generator>Hugo</generator><language>en-nz</language><lastBuildDate>Sun, 14 May 2017 19:21:02 +1200</lastBuildDate><atom:link href="http://tonyandrewmeyer.com/tags/email/index.xml" rel="self" type="application/rss+xml"/><item><title>A better WannaCry advisory for schools</title><link>http://tonyandrewmeyer.com/2017/05/14/a-better-wannacry-advisory-for-schools/</link><pubDate>Sun, 14 May 2017 19:21:02 +1200</pubDate><guid>http://tonyandrewmeyer.com/2017/05/14/a-better-wannacry-advisory-for-schools/</guid><description>&lt;p>The Ministry of Education sent out a very poor advisory to schools about &amp;ldquo;WannaCry&amp;rdquo; today, based primarily (from what it seems) on the poor information coming from CERT-NZ. The advisory contains several factual errors, which the Ministry should not be spreading to schools.
I&amp;rsquo;ve written an improved advisory (I&amp;rsquo;ll update it as required).&lt;/p>
&lt;h1 id="an-improved-version-of-an-urgent-message-from-the-ministry-of-education">(An improved version of an) Urgent message from the Ministry of Education&lt;/h1>
&lt;p>The weekend media reported on a virus called WannaCry (also WannaCrypt, WanaCrypt0r, WCrypt, and WCRY) that infected many computer systems around the world over the last few days, including very prominent organisations such as the NHS in the UK.
It appears that few infections have occured in New Zealand, but it is possible that your school may have been, or may be, at risk. We are writing to let you know what you should do, and what we are doing to protect schools.&lt;/p></description></item><item><title>Mailbox flattening messages</title><link>http://tonyandrewmeyer.com/2009/08/30/mailbox-flattening-messages/</link><pubDate>Sun, 30 Aug 2009 21:35:44 +1200</pubDate><guid>http://tonyandrewmeyer.com/2009/08/30/mailbox-flattening-messages/</guid><description>&lt;p>The &lt;a href="http://docs.python.org/library/mailbox.html">mailbox.py&lt;/a> code does this to dump a message (e.g. when adding to a Maildir file):&lt;/p>
&lt;pre tabindex="0">&lt;code>def _dump_message(self, message, target, mangle_from_=False):
 # Most files are opened in binary mode to allow predictable seeking.
 # To get native line endings on disk, the user-friendly \n line endings
 # used in strings and by email.Message are translated here.
 &amp;#34;&amp;#34;&amp;#34;Dump message contents to target file.&amp;#34;&amp;#34;&amp;#34;
 if isinstance(message, email.Message.Message):
 buffer = StringIO.StringIO()
 gen = email.Generator.Generator(buffer, mangle_from_, 0)
 gen.flatten(message)
 buffer.seek(0)
 target.write(buffer.read().replace(&amp;#39;\n&amp;#39;, os.linesep))
 elif isinstance(message, str):
 if mangle_from_:
 message = message.replace(&amp;#39;\nFrom &amp;#39;, &amp;#39;\n&amp;gt;From &amp;#39;)
 message = message.replace(&amp;#39;\n&amp;#39;, os.linesep)
 target.write(message)
&lt;/code>&lt;/pre>&lt;p>(There&amp;rsquo;s a bit more that deals with other types of message).  Unfortunately, with some messages containing Unicode characters, this breaks with a UnicodeDecodeError:&lt;/p></description></item></channel></rss>