<div>
<p dir="auto">Hi MailMate users,</p>

<p dir="auto">before the weekend I wanted to provide you with the current status of MailMate. It has been a few weeks since the latest beta/test version of MailMate (r5107/r5108), but it's not because I have been on vacation that long. The main reason is that I've been working on some of the oldest short-comings of MailMate related to the handling of HTML and this has involved quite a lot of changes.</p>

<p dir="auto">I don't have any major new <strong>complete</strong> features for you to test yet, but I do have a new update for you. Its primary purpose is to ensure that I haven't broken a lot of things while working on the HTML issues. It can be fetched as a direct download <a href="%E2%80%98http://updates.mailmate-app.com/archives/MailMate_r5109.tbz">here</a> (r5109). It's not available via the Software Update preferences pane, because currently I don't want anyone to download it if they are not ready to report any new issues.</p>

<p dir="auto">I cannot make any promises on when these features are complete. Right now I have to focus on fixing a bunch of minor issues to make MailMate ready for a public El Capitan capable release.</p>

<p dir="auto">The following are the features I've been working on. It's a bit early to announce all this, but I expect we can keep their existence on the mailing list for now :-)</p>

<h3>Inlining of HTML</h3>

<p dir="auto">This is the important one. MailMate is going to continue having a plain text editor, but it'll be possible to inline HTML messages when forwarding and replying. When MailMate generates an HTML body part then the original HTML is inlined and that should work at least as well as any HTML capable email client. The plain text in the composer is going to show the plain text variant of the inlined HTML, but it'll be non-editable (for obvious reasons). If the user tries to edit the plain text then MailMate offers to drop the inlined HTML body part (essentially providing the current behavior). This can be suppressed such that it happens automatically.</p>

<p dir="auto">There is a hidden preference to enable it, but the feature is still incomplete. The main issue is related to HTML emails containing so-called related body parts (inlined images). In other words, this is not quite ready for testing yet. Sorry.</p>

<h3>Styling</h3>

<p dir="auto">Until now MailMate has generated unstyled HTML. This is great because then the default styling of the email client of the recipient is in charge — displaying all incoming emails in the same way. Unfortunately the default styling s*cks in many email clients resulting in MailMate messages looking ugly, e.g., without any styling of quoted blocks (Apple Mail) or an ugly font (Outlook webmail). Ironically, there are no such issues when sending a plain text message without an HTML alternative.</p>

<p dir="auto">I've implemented it such that a default theme can be configured, but I've also added that each signature can be bound to a specific theme. Some details are still missing and this is also not quite ready for testing. Sorry.</p>

<blockquote style="border-left-color: #136BCE; border-left-style: solid; border-left-width: 2px; color: #136BCE; margin: 0 0 5px; padding-left: 5px">
<p dir="auto">The feature is enabled for this email which means that this paragraph should have a vertical blue line in most (all?) HTML capable email clients — including Apple/iOS Mail.</p>
</blockquote>

<h3>Code styling</h3>

<p dir="auto">This is probably the most complete feature. It's mostly missing GUI settings. It is based on a new bundle named Pygments which currently has to be fetched manually:</p>

<pre style="background: #E4E4E4; border: thin solid gray; margin-left: 15px; margin-right: 15px; overflow: auto; padding: 5px"><code>mkdir -p ~/Library/Application\\ Support/MailMate/Bundles
cd ~/Library/Application\\ Support/MailMate/Bundles
git clone https://github.com/mailmate/pygments.mmBundle
</code></pre>

<p dir="auto">It is also necessary to tell MailMate to use a specific command in the bundle for code styling:</p>

<pre style="background: #E4E4E4; border: thin solid gray; margin-left: 15px; margin-right: 15px; overflow: auto; padding: 5px"><code>defaults write com.freron.MailMate MmBundleCommandForCodeStyling -string E4464365-9FE3-487C-8B39-D3B0F632F1D8
</code></pre>

<p dir="auto">Finally, it's possible to configure the style used. This is equivalent to the default:</p>

<pre style="background: #E4E4E4; border: thin solid gray; margin-left: 15px; margin-right: 15px; overflow: auto; padding: 5px"><code>defaults write com.freron.MailMate MmDefaultPygmentsStyleName colorful
</code></pre>

<p dir="auto">The possible values are:</p>

<pre style="background: #E4E4E4; border: thin solid gray; margin-left: 15px; margin-right: 15px; overflow: auto; padding: 5px"><code>manni igor xcode vim autumn vs rrt native perldoc borland
tango emacs friendly monokai paraiso-dark colorful murphy
bw pastie paraiso-light trac default fruity
</code></pre>

<p dir="auto">If I remember correctly those with a dark background do not yet work well.</p>

<p dir="auto">Oh, and here is an example of the feature in use:</p>

<code>
<div class="highlight" style="background: #ffffff"><pre style="line-height: 125%">    <span style="color: #888888">// This is C++ code</span>
    <span style="color: #008800; font-weight: bold">for</span>(<span style="color: #333399; font-weight: bold">int</span> i<span style="color: #333333">=</span><span style="color: #0000DD; font-weight: bold">0</span>; i <span style="color: #333333"><</span> <span style="color: #0000DD; font-weight: bold">42</span>; <span style="color: #333333">++</span>i)
        printf(<span style="background-color: #fff0f0">"Hello world</span><span style="color: #666666; font-weight: bold; background-color: #fff0f0">\\\\</span><span style="background-color: #fff0f0">n"</span>);
</pre></div>

</code>

<p dir="auto">And this is what I wrote to get that:</p>

<pre style="background: #E4E4E4; border: thin solid gray; margin-left: 15px; margin-right: 15px; overflow: auto; padding: 5px"><code>~~~c++
    // This is C++ code
    for(int i=0; i < 42; ++i)
        printf("Hello world\\\\n");
~~~
</code></pre>

<h3>Math styling</h3>

<p dir="auto">The last feature is also mostly complete, but unfortunately it probably has limited use cases, because it's not supported by all receiving email clients. Then again, if you know who you are writing then it's a pretty cool feature.</p>

<p dir="auto">Again, first manually install a bundle:</p>

<pre style="background: #E4E4E4; border: thin solid gray; margin-left: 15px; margin-right: 15px; overflow: auto; padding: 5px"><code>mkdir -p ~/Library/Application\\ Support/MailMate/Bundles
cd ~/Library/Application\\ Support/MailMate/Bundles
git clone https://github.com/mailmate/asciimath.mmBundle
</code></pre>

<p dir="auto">And enable the feature like this:</p>

<pre style="background: #E4E4E4; border: thin solid gray; margin-left: 15px; margin-right: 15px; overflow: auto; padding: 5px"><code>defaults write com.freron.MailMate MmBundleCommandForMathStyling -string A5574670-971A-47B4-86F8-A2901F252613
</code></pre>

<p dir="auto">It's also necessary to manually install `asciimathml` (ideally, the bundle command should do this like it does for the Pygments bundle):</p>

<pre style="background: #E4E4E4; border: thin solid gray; margin-left: 15px; margin-right: 15px; overflow: auto; padding: 5px"><code>sudo easy\_install asciimathml
</code></pre>

<p dir="auto">The bundle provides you with the ability to have inline math, <span><math><mstyle><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><msup><mi>i</mi><mn>3</mn></msup></mstyle></math></span>, by writing this: `<span><math><mstyle><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><msup><mi>i</mi><mn>3</mn></msup></mstyle></math></span>`. Larger sections of math can be done like this</p>

<pre style="background: #E4E4E4; border: thin solid gray; margin-left: 15px; margin-right: 15px; overflow: auto; padding: 5px"><code>$$
sum\_(i=1)^n i^3=((n(n+1))/2)^2
$$
</code></pre>

<p dir="auto">which looks like this</p>

<p dir="auto"></p>
<div style="text-align: center" align="center"><math><mstyle><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><msup><mi>i</mi><mn>3</mn></msup><mo>=</mo><msup><mrow><mo>(</mo><mfrac><mrow><mi>n</mi><mrow><mo>(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow></mrow><mn>2</mn></mfrac><mo>)</mo></mrow><mn>2</mn></msup></mstyle></math></div>

<p dir="auto">The ASCIIMath markup language is described <a href="http://asciimath.org">here</a>. And I repeat, this feature does not work well in many receiving email clients. Apple/iOS Mail is doing fine since they are also based on Webview, but other HTML engines do not support MathML (which is what the bundle command generates). Webmail clients like Gmail and iCloud remove the MathML markup generated making the math disappear even if using Safari (which does support MathML).</p>

<p dir="auto">(It's implicit in the above, but it's possible to create your own bundle with a different syntax highlighter or a different math generator and then configure MailMate to use them.)</p>

<p dir="auto">That's it. Have a nice weekend and remember that all of the above is work in progress. Right now I'm mostly interested in side-effects of my changes affecting the regular use of the composer.</p>

<p dir="auto">-- <br>
Benny</p>

</div>