[MlMt] MailMate needs to be updated warning

Benny Kjær Nielsen mailinglist at freron.com
Sat Apr 9 04:11:32 EDT 2022


On 7 Apr 2022, at 0:21, Erik Mueller-Harder wrote:

> I have no idea what Juice is, or Premailer (tho I can guess they’re 
> probably Markdown → HTML conversion libraries), or why either one 
> would have been selected instead of the other — but I can confirm 
> that with Juice selected *finally*​ I can again use Markdown with 
> MailMate!

The following is mostly to have something on record on this subject.

Both Juice and Premailer are third party utilities which can be used to 
inline the use of stylesheets (CSS) in HTML email. I'll give an example. 
First, here's the HTML needed to quote some text:

```html
<blockquote>
Replied text is quoted.
</blocquote>
```

The HTML above could be the result of, e.g., a Markdown converter (where 
MailMate uses the GitHub flavour of `cmark` now). For non-Markdown 
users, MailMate has its own built-in conversion to HTML.

Styling the above can be done by inserting a stylesheet within the HTML. 
That could look something like this:

```css
<style>
blockquote {
	color: blue;
}
</style>
```

Email clients capable of displaying HTML (with CSS) will then make sure 
that blockquotes are blue. This works just like a webpage. That's all 
very nice, but there is a major problem: HTML has no way to handle the 
concept of replied/forwarded HTML, because HTML was designed for 
webpages and not for emails. In particular, the `<blockquote>` tag was 
not designed to be used in emails. If it was, then there would likely be 
some way to have multiple stylesheets to be used at different quote 
levels. (In theory, that could possibly work, but it wouldn't make HTML 
emails less bloated than they already are.)

In practice, the only solution is to get rid of the separate stylesheet 
and make sure all styling is done directly on the HTML tags. For the 
example above, this would mean generating HTML which looks like this:

```html
<blockquote style="color: blue">
Replied text is quoted.
</blocquote>
```

That would survive nicely if embedded in another reply.

The above is a very simple example. Now, imagine one of those marketing 
emails you receive which looks like a webpage by email. This might 
contain a huge stylesheet doing all sorts of HTML/CSS tricks. 
Essentially, anything possible in a web browser. The user might choose 
to forward it and everthing then goes into a blockquote, but the 
stylesheet affects everything including whatever is written above the 
forwarded HTML. It needs to be inlined like the simple example above, 
but this is extremely complicated (and in some cases impossible). This 
is why MailMate uses a third party utility. In the past, MailMate has 
used Premailer but I've not been very good at keeping it up-to-date and 
some times it has broken down when Apple has changed what is included 
with a default install of macOS. On macOS 12.3, it broke completely when 
only `python3` was included. In the beta/test releases I've added the 
option of using Juice which is based on javascript. This is both more 
robust (and faster).

Note: The CSS inliner is also used when printing because this often 
involves merging multiple HTML documents (there might be a way to avoid 
this with the new message view, but I'm not 100% sure).

The latest test release has removed Premailer as an option on macOS 12. 
Hopefully this means fewer issues for users. I understand most of the 
above is likely nonsense for most users :)

I'm a bit unsure if Juice works properly all the way back to macOS 10.12 
(which MailMate still supports) which is why I haven't removed Premailer 
completely.

> I’ll confess that for the last two or three months I’ve been using 
> FastMail’s web interface just so I could do the small bit of email 
> formatting that I need to do.  I’ve been missing MailMate!  It’s 
> good to be back.

I'm glad you are back. I'm aware that the lack of a public release 
working properly on macOS 12 (and to some extent macOS 11) is a major 
problem. (It's important for the future of MailMate that this changes as 
soon as possible.)

> Benny, I should have done it long ago, but am now an official Patron.  
> Thank you so much for the care and dedication you’ve poured into 
> this indispensable app.

Thanks for the support! The patrons are currently what keeps MailMate 
running.

-- 
Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20220409/78c639d7/attachment.htm>


More information about the mailmate mailing list