updated email formatting draft post
All checks were successful
/ deploy (push) Successful in 25s

This commit is contained in:
Daniel Fichtinger 2025-07-14 15:29:30 -04:00
parent 7dcb9b6a51
commit 735101cd4f

View file

@ -8,18 +8,34 @@ draft: true
[Kakoune]: https://kakoune.org
[^html]: The first email was sent in 1971 --- HTML was specified in 1990.
[TOC]
As I've [mentioned before](./email-in-kakoune.md), I like using [Kakoune] for
reading & writing emails. Of course, Kakoune is a text editor, not a _rich text_
editor. It operates on UTF-8 _plaintext_ --- which means that the emails I write
need to be in plaintext, too.
editor. It operates on UTF-8 _plain text_ --- which means that the emails I
write need to be in plain text, too.
As I went down this path, I quickly discovered that I needed an **email
formatter**. I eventually wrote [`mailfmt`](https://git.sr.ht/~ficd/mailfmt) to
fill this niche. It provides consistent paragraph spacing, hard-wrapping and
paragraph reflow, while preserving Markdown syntax, email headers, quotes,
sign-offs, and signature blocks. Additionally, the wrapped output can be made
safe for passing to a Markdown parser. This is useful if you want to build an
HTML email from plain-text.
As it turns out, plain-text email (which predates HTML by decades[^html]) hasn't
really left a "legacy" so much as it _hasn't actually gone anywhere_. Many
developers swear by it; some are even so committed as to automatically filter
`text/html` mail as spam. If you want to learn more, you can begin by reading
[Drew DeVault's post](https://drewdevault.com/2016/04/11/Please-use-text-plain-for-emails.html),
[useplaintext.email](https://useplaintext.email/#why-plaintext), and sourcehut's
[mailing list etiquette](https://man.sr.ht/lists.sr.ht/etiquette.md) guide.
As I went down `text/plain` path, I quickly learned that I needed an **email
formatter**. Plain text is like source code. You can't rely on the recipient's
mail client to render it in a certain way --- most often, what you see is
_exactly_ what they get.
I eventually wrote [`mailfmt`](https://git.ficd.sh/ficd/mailfmt) to fill this
niche. It provides consistent paragraph spacing, hard-wrapping and paragraph
reflow, while preserving Markdown syntax, email headers, quotes, sign-offs, and
signature blocks. Additionally, the wrapped output can be made safe for passing
to a Markdown parser. This is useful if you want to build an HTML email from
plain-text.
`mailfmt` open-source under the ISC license, and is available on
[PyPI](https://pypi.org/project/mailfmt/) for installation with tools like