News for hackers. Stuff that matters.
Re:Can I Email: ‘Can I Use’ for email by ktpsns on Thursday September 12, 2019 @04:27AM (#20949245)
It would be really nice to have a small and simple markup language, say some markdown standard, to be the layouting language for E-Mails. No (external) images, just links, lists, headings, basic formatting.

HTML E-Mails are a security nightmare, even if "only" CSS is "allowed" and JS/iframes/external images are not loaded.

Re:Can I Email: ‘Can I Use’ for email by jcranmer on Thursday September 12, 2019 @09:44AM (#20951346)
You're basically advocating for text/richtext (aka text/enriched), which was originally proposed explicitly as a replacement for HTML in email. It failed essentially because everyone who didn't want HTML wanted only plain text, and everyone who wanted something like HTML was happy to just use HTML.

Factoid of the day: Netscape added support for a <blink> tag to text/enriched bodies, and that support remains in every client that's still using Netscape's MIME code. The comment above this code just says: "Of course, both text/richtext and text/enriched must be enhanced somehow... Or else what would people think."

Re:Can I Email: ‘Can I Use’ for email by chrismorgan on Thursday September 12, 2019 @09:53AM (#20951435)
From RFC 1896:

> There are other text formatting standards which meet some of these criteria. In particular, HTML and SGML have come into widespread use on the Internet. However, there are two important reasons that this document further promotes the use of text/enriched in Internet mail over other such standards:

> 1. Most MIME-aware Internet mail applications are already able to either properly format text/enriched mail or, at the very least, are able to strip out the formatting commands and display the readable text. The same is not true for HTML or SGML.

> 2. The current RFC on HTML [RFC-1866] and Internet Drafts on SGML have many features which are not necessary for Internet mail, and are missing a few capabilities that text/enriched already has.

> For these reasons, this document is promoting the use of text/enriched until other Internet standards come into more widespread use. For those who will want to use HTML, Appendix B of this document contains a very simple C program that converts text/enriched to HTML 2.0 described in [RFC-1866].

It sounds to me like text/enriched was being proposed not so much as a replacement for HTML, but because HTML and related technologies were not yet mature enough. This wording expressly frames text/enriched as a stop-gap measure.

Re:Can I Email: ‘Can I Use’ for email by archgoon on Thursday September 12, 2019 @01:23PM (#20953990)
Re:Can I Email: ‘Can I Use’ for email by cygned on Thursday September 12, 2019 @06:30AM (#20949903)
No markdown, but we had success with this one: https://mjml.io/

Try out the online examples.

Re:Can I Email: ‘Can I Use’ for email by adamredwoods on Thursday September 12, 2019 @11:09AM (#20952334)
We use https://foundation.zurb.com/emails.html It is essentially rows and columns, but the support has been great across Outlook and gmail, as well as mobile support.
Re:Can I Email: ‘Can I Use’ for email by justinator on Thursday September 12, 2019 @01:25PM (#20954013)
The only problem I guess is that the last release was over three years ago, and some bugs are starting to show (saying nothing of any added features). The pace of the npm environment is moving so fast, that it's sometimes hard to even get a project up and running.

Things feel a little stale.

For example (from this week of my adventures with Foundation for Emails) Google Fonts almost sort of work for email, but there's just no real easy way to tell this framework to use them, or call any web font.

Re:Can I Email: ‘Can I Use’ for email by gitgud on Thursday September 12, 2019 @08:42AM (#20950742)
Wow, that's pretty cool, what's the consistency across different clients like?

Having email rendered consistently across many email clients was the main reason we stayed with Mail Chimp for so long...

Re:Can I Email: ‘Can I Use’ for email by erichurkman on Thursday September 12, 2019 @09:18AM (#20951070)
It's pretty good. A few clients are still PITA (looking at you, Outlook 2007 and Yahoo mail. You still have to do jump through hoops for accurate background images, or fancy things with borders.

The actual markup MJML generates is terrifying, and can be very large payloads. A simple hero graphic, some styled body text, a few buttons, and a footer was around 60KB/message. It got gnarly for us as our MTA had a max-payload size per API 'send' call (Mandrill) so our max send rates were partially constrained by MJML's fat markup.

But totally worth it to not spend _as_ much time satisfying the mail clients of the world.

Re:Can I Email: ‘Can I Use’ for email by marpstar on Thursday September 12, 2019 @09:33AM (#20951231)
I agree with all of this. When you really start to dig in to cross-client compatibility (and you observe what MJML does to provide it) you start to get a sense that NOT using a tool like MJML is a hopeless path.
Re:Can I Email: ‘Can I Use’ for email by pintxo on Thursday September 12, 2019 @07:38AM (#20950297)
Thanks, looks like a great solution.
Re:Can I Email: ‘Can I Use’ for email by gpvos on Thursday September 12, 2019 @04:36AM (#20949306)
Re:Can I Email: ‘Can I Use’ for email by Moru on Thursday September 12, 2019 @06:54AM (#20950033)
Email is so fun, every time someone comes with a new idea, someone pulls out an RFC detailing it. Dated 20+ years back.
Re:Can I Email: ‘Can I Use’ for email by gpvos on Thursday September 12, 2019 @07:02AM (#20950083)
It even has a predecessor from 1992, see paragraph 7.1.3 of http://www.rfc-editor.org/rfc/rfc1341.txt .
Re:Can I Email: ‘Can I Use’ for email by ktpsns on Thursday September 12, 2019 @04:40AM (#20949330)
Thanks for the RFC link. Yes, basically.

I mean, different mime versions of the same content are a possibility to do this transition: Send both plaintext, HTML and markdown, and the receiver could choose to display markdown if he otherwise would display plain text.

To be honest, this won't come. Google is pushing AMP into mails, that's exactly the opposite direction.

Re:Can I Email: ‘Can I Use’ for email by sjwright on Thursday September 12, 2019 @05:39AM (#20949662)
It’s so stupid. If AMP emai ever became a thing, every single non google email client would just fetch and store the contents of the AMP page the moment an AMP email arrives. So what was the point of it?
Re:Can I Email: ‘Can I Use’ for email by rypskar on Thursday September 12, 2019 @07:04AM (#20950099)
Not so sure about that, not downloading anything extra and only showing what is embedded in the email is one of the good things with using an email client. Using AMP email is back to thinking tracking pixels works in emails
Re:Can I Email: ‘Can I Use’ for email by jlokier on Thursday September 12, 2019 @08:11AM (#20950511)
If the content isn't inline, perhaps it's better to have the mail server fetch it when the email is received, so that the sender can't track whether you are reading it.

This has been discussed before with regard to external links to images. I think that always made sense, but it makes even more sense to do this when the core content is external. Then fetching it would be just another part of the SMTP/HTTP transaction sequence to deliver a mail.

Re:Can I Email: ‘Can I Use’ for email by sjwright on Thursday September 12, 2019 @08:26AM (#20950618)
Exactly. If most mail clients downloaded it automatically upon receipt instead of on view then the tracking benefits get diluted to the point of uselessness.

(Actually, thinking further it would have to be done server side to avoid leaking your personal IP. For a webmail provider that’s obviously straightforward, while IMAP servers could be extended to automatically replace AMP email directives with a static HTML attachment.)

Re:Can I Email: ‘Can I Use’ for email by jcranmer on Thursday September 12, 2019 @09:34AM (#20951241)
So you want RFC 2017 basically?
Re:Can I Email: ‘Can I Use’ for email by sjwright on Friday September 13, 2019 @07:36AM (#20961144)
No, I want AMP email to never happen. Failing that, I want the email server to un-AMP-ify incoming emails for me.
Re:Can I Email: ‘Can I Use’ for email by rypskar on Friday September 13, 2019 @01:34AM (#20959459)
Should it do that for all emails sent to the domain, or only for valid addresses? If they only fetch for addresses in use this will open up for an easy way for spammers to verify if an address is in use or not
Re:Can I Email: ‘Can I Use’ for email by jlokier on Friday September 13, 2019 @09:12AM (#20961773)
Spammers can already verify if an address is _accepted_ because their message will be rejected with an error code at SMTP transmission time if it isn't.

The first stage of spam filtering, and greylisting, also reject at SMTP transmission time.

I'd do the HTTP fetch when SMTP is about to accept the message, making the HTTP round trip just another part of the transaction.

Since spam filtering is likely to look at the HTTP response, you might want to reject the SMTP transaction after seeing the HTTP response, rather than accept the SMTP transaction based on address alone.

Re:Can I Email: ‘Can I Use’ for email by psimyn on Thursday September 12, 2019 @09:47AM (#20951374)
Isn't AMP for email kinda what you are describing?

"The AMP version of the message is embedded into the email as a new MIME part, in addition to the HTML and plaintext, ensuring compatibility across all mail clients"

From https://amp.dev/documentation/guides-and-tutorials/start/cre...

Re:Can I Email: ‘Can I Use’ for email by yuft on Thursday September 12, 2019 @02:11PM (#20954496)
Isn't markdown just turned into html?
Re:Can I Email: ‘Can I Use’ for email by bscphil on Thursday September 12, 2019 @10:42PM (#20958693)
Markdown strikes me as a much improved version of exactly this, with the advantage that you don't have to have a supporting client to read the email, since it's simply plain text.

I want to see email clients start to support Markdown, so I can just send it to everyone.

Re:Can I Email: ‘Can I Use’ for email by captn3m0 on Friday September 13, 2019 @04:03AM (#20960119)
Not just email, I’d like to see browsers support Markdown natively. You can style your content. All media sites can be 100% markdown without any JS.
Re:Can I Email: ‘Can I Use’ for email by matharmin on Thursday September 12, 2019 @05:48AM (#20949698)
Markdown is nice for composing, but not as a standard to be supported by many clients. CommonMark is an improvement, but there is way to many ambiguities and differences in supported features over different markdown parsers for it to be feasibly used as a standard.

Markdown is also not any better than HTML in terms of security - most markdown parsers allow passing through arbitrary HTML, and then depend on sanitizing the HTML for security.

What you are asking for is effectively a smaller subset of HTML to be used for for email (which is kind of how it started...)

Re:Can I Email: ‘Can I Use’ for email by jandrese on Thursday September 12, 2019 @11:52AM (#20952897)
This is a bigger issue than most people care to admit. I post stuff to a number of different sites that support "Markdown" and not a single one agrees on even something a simple as how to format a hyperlink. I end up having to hit the help page on every site to remember which syntax they use, if they even support the feature at all. HTML might be "ugly", but at least it is consistent.
Re:Can I Email: ‘Can I Use’ for email by tzs on Thursday September 12, 2019 @02:35PM (#20954773)
I wish there was a browser extension to handle that. It would provide an editing area that would allow you to edit using the same markup on different sites, and when you are done would translate to whatever markup format that site uses and fill in the site's edit area with that.
Re:Can I Email: ‘Can I Use’ for email by jandrese on Thursday September 12, 2019 @02:54PM (#20955011)
There are some bits of typical markdown syntax that I really don't like. Like pasting code requires you to add 4 spaces to the start of every line and an extra linefeed between each line. That's a lot of work and every time I do it I say "How is this better than <pre></pre>?"

I've yet to see what I'd really like: preformatted text being surrounded by markers that make it easy to paste in, like so:

    Some regular text

    vvvvv

    Preformatted text

    ^^^^^
It would be cool if the extension could do that and then do all of that obnoxious formatting for me. Or heck, it could be a full up WYSIWYG editor.
Re:Can I Email: ‘Can I Use’ for email by jefftk on Thursday September 12, 2019 @06:02PM (#20956941)
The most common way to do this is with triple backticks:

    Some regular text

    ```
    Preformatted text
    ```
While this isn't in the original spec (https://daringfireball.net/projects/markdown/syntax#precode) it's supported by GitHub, Stack Overflow, and most other places I find myself using a markdown flavor.
Re:Can I Email: ‘Can I Use’ for email by eridius on Friday September 13, 2019 @01:30AM (#20959434)
This syntax even made its way into CommonMark (https://spec.commonmark.org/0.29/#fenced-code-blocks)
Re:Can I Email: ‘Can I Use’ for email by jen729w on Thursday September 12, 2019 @04:52PM (#20956329)
> ...every time I do it I say "How is this better than <pre></pre>?"...

From Gruber’s Markdown spec:

> Readability, however, is emphasized above all else.

Re:Can I Email: ‘Can I Use’ for email by greghendershott on Thursday September 12, 2019 @08:49AM (#20950812)
Not sure why you're being down-voted. (As usual here, only clicking a down-vote button contributes little value.)

- You are correct that implementing markdown consistently is hard because there is no real spec. CommonMark is a spec, which helps, but a heroically thorough spec, so it's still not exactly trivial to implement.

- You are correct that markdown can escape to HTML. Indeed certain marketing email "features" probably would do this?

If I am missing something maybe someone could make an actual contribution to the discussion and explain.

In any case I think by far the most important point was made elsewhere: Google AMP is awful for the web and for email, both.

p.s. edit: Actually, I think the even more important point is that anything except plain text email is awful. :) So there, sure, use markdown or org-mode formatting conventions. Humans are pretty good at handling messy human protocols.

Re:Can I Email: ‘Can I Use’ for email by m463 on Thursday September 12, 2019 @04:01PM (#20955779)
Why is markdown so popular? It seems so braindead.
Re:Can I Email: ‘Can I Use’ for email by holy_city on Thursday September 12, 2019 @04:38PM (#20956189)
# why is markdown so popular? ## (my opinion)

Markdown is fast to type for the majority of use cases since you have:

- bullet points

- headings

- __bold__

- __italic__

- `inline code`

- etc

```

fn you_even(_have: &str) -> &str { "nifty little code blocks without needing to indent" }

```

And more importantly, markdown syntax preserves the structure of the document without harming legibility, unlike say latex or HTML. That limits it, since the syntax is small, but also reduces friction in learning/writing markdown.

Also, Reddit + GitHub.

Re:Can I Email: ‘Can I Use’ for email by m463 on Thursday September 12, 2019 @05:12PM (#20956514)
Sorry, poor choice of words.

I thought hacker news used markdown, but I guess has its own thing.

I can see the severely constrained formatting options of hacker news has both positive and negative consequences.

Re:Can I Email: ‘Can I Use’ for email by vinniejames on Thursday September 12, 2019 @07:58AM (#20950421)
Try Foundation https://foundation.zurb.com/emails.html

I've used it on several projects, it speeds things up quite a bit

Re:Can I Email: ‘Can I Use’ for email by aloisdg on Thursday September 12, 2019 @04:51AM (#20949396)
Beside, I am using Markdown in all my email thanks to https://markdown-here.com/ and Thunderbird
Re:Can I Email: ‘Can I Use’ for email by dngray on Thursday September 12, 2019 @05:25AM (#20949583)
Markdown Here appears to be unmaintained and is certainly incompatible with Thunderbird 68.0. I have not been able to raise the developer of it at all and PRs are not being merged.

https://github.com/adam-p/markdown-here/issues/577

Re:Can I Email: ‘Can I Use’ for email by zczc on Thursday September 12, 2019 @12:20PM (#20953288)
The idea behind Markdown Here is good, but it has some issues like keeping a copy of the markup text base-encoded in some html attribute which can be lead to unintentionally leaking full text while forwarding part of the message.
Re:Can I Email: ‘Can I Use’ for email by neop1x on Friday September 13, 2019 @07:13AM (#20961022)
The idea of markdown is great because it it essentially a text. Even if the client would not support it, humans would be able to read it just fine. Much better and more secure than rich HTML. For example my email client won't display images by default and I am happy with that. Rich HTML should be on the web only IMO!
Re:Can I Email: ‘Can I Use’ for email by t0astbread on Thursday September 12, 2019 @06:00AM (#20949760)
This + multipart/alternative email and maybe something like uMatrix or similar firewall mechanisms in mail clients
Re:Can I Email: ‘Can I Use’ for email by hawski on Thursday September 12, 2019 @06:58AM (#20950052)
But isn't Markdown a sugar on top of HTML? When something does not fit Markdown one is supposed to write inline HTML.