Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
MailFlow 2
==========
MailFlow 2 is a MailKit extension for Apple Mail on macOS 14.x and later,
taming its enthusiasm for quoted-printable encoding, and enabling it
to emit format=flowed plain-text messages. It registers as an outbound
message security handler, where "encryption" strips the overzealous
quoted-printable encoding, and "signing" also flows the text.
History
-------
Many years ago, Mail was a decent 'net citizen. It could be configured to
generate text/plain email, and would do so with the text neatly wrapped
at 76 columns. In addition, it used the RFC2646 format=flowed extension
to indicate that these wrapped paragraphs could be reflowed. Thus mailing
list archives and traditional mail clients saw readable 80-column text
without noisy encoding, but more sophisticated readers could re-fill the
paragraphs to suit the display width.
Like most Apple software, Mail has starkly declined in quality over the
years. Bugs are frequently introduced, then remain unfixed for decades.
In late 2009, it ditched format=flowed, instead opting to emit each
paragraph as a single long line. If this is longer than 77 characters, the
text is mangled with a quoted-printable transfer encoding. The resulting
email leaves a very visible mess in mailing list archives on the web,
as well as drawing understandable ire from recipients with traditional
unix mail clients.
MailFlow (my earlier plugin) monkey-patched Apple Mail to emit format=flowed
plain-text messages, also fixing a bug when displaying leading whitespace,
and broken quoting/attribution in replies. MailWrap was an older alternative
which added manual line-wrapping and paragraph filling shortcuts in the
message composer. Such plugins have been blocked on modern versions of
macOS, as part of a wider campaign against user freedom, though obviously
the problems they fixed remain.
MailFlow 2 is an alternative way to coax Apple Mail into emitting better
MIME, repurposing the MailKit message security handler hooks to label
the text/plain fixups as "encryption" and "signing". Alas, unlike the
older plugins, it can’t fix Mail's broken reply quoting/attribution,
nor the display of leading whitespace in non-flowed text/plain messages.
The existence of this extension should not be taken as an endorsement of
Apple's poor-quality software, or of their user-hostile security stance.
Building and installing
-----------------------
To build and install MailFlow.app to /Applications, run 'make install'
at the top of the source tree. Alternatively, you can just run 'make'
and copy the generated MailFlow.app to your preferred install location.
Apple's command-line tools are required, but full XCode is not. They can
be installed with 'xcode-select --install' if missing.
MailFlow.app itself is a dummy application which immediately exits when run.
Its function is to carry a signature and contain the signed MailFlow.appex
bundle which provides the Mail.app extension.
Once it has been run in its new home, MailFlow should be visible in the
Extensions tab of Mail -> Settings. Tick this to enable it.
Features
--------
When composing a message, small padlock and seal symbols will appear at
the right side of the Subject: line. Select the padlock ("encrypt") to
switch from quoted-printed to plain 7bit/8bit encoding. Select the seal
("sign") to also use format=flowed. These toggles will retain their state
between messages.
To avoid embarrassment, you will still need to manually fix attribution
lines in replies, which are incorrectly '> '-quoted by Mail. They have
been broken since Apple Mail 8.0 in 2014.
Acknowledgements
----------------
This code is my own; I enjoy programming and I'm too selfish to share.
However, connected via my https://github.com/arachsys/ua harness, Claude
Fable 5 proved an excellent sounding board and adversarial tester,
identifying a number of subtle MIME-handling bugs during development.
Fable 5 also independently ran xcodebuild on Apple's MailKit examples
then sifted through many pages of unreadably-long compiler and linker
invocations to identify the handful of swiftc flags actually needed to
build a MailKit extension with command-line swiftc in a Makefile.
The collaboration was fun, and MailFlow 2 is better because of it.
Copying
-------
This software was written by Chris Webb <chris@arachsys.com> and is
distributed as Free Software under the terms of the MIT license in COPYING.