~exprez135/mailflow

568dad64 — Nate Ijams 9 months ago master
Wrap text to 72 characters instead of 76, update README
Fix installer to work on macOS 10.15 and later

Mail.app moved from /Applications to /System/Applications in macOS 10.15
Catalina. Check both locations when reading Mail.app version and
compatibility UUIDs.

Fix contributed by Ethan Jackwitz <ethanjackwitz@gmail.com>
52c60dc9 — Chris Webb 2 years ago
Update installation instructions for macOS 10.14
47fe3192 — Chris Webb 2 years ago
Fix a rare bug when sending a message with an empty body text
684b6dd0 — Chris Webb 3 years ago
Preserve names containing commas when fixing attribution line

Trim the attribution line a little less aggressively to avoid removing
parts of the sender's name before the last comma.
e71d6c62 — Ryan Huang 3 years ago
Fix installer to work on patch releases of macOS

The install.py script incorrectly creates a key

  Supported10.13.1PluginCompatibilityUUIDs

instead of

  Supported10.13PluginCompatibilityUUIDs

in the plugin bundle's Info.plist on macOS 10.13.1. Ignore the patch
component of the OS version number when generating this key.
2f4341a9 — Chris Webb 3 years ago
Fix rendering of indented lines in text/plain parts again

Whilst it would be shocking to discover that Apple have fixed their
long-standing rendering bug with indented lines in text/plain parts, it
is less surprising to find that random code churn has broken our fix.

Swizzle the _decodeText selector of MCMimePart rather than
_decodeTextPlain as the latter is now missing in action.
89788593 — Chris Webb 3 years ago
Monkey patch shutil.copystat to work around Apple incompetence

Apple carelessly broke their bundled py2app when implementing the System
Integrity Protection feature in OS X 10.11 'El Capitan'. It is still
broken in macOS 10.13 'High Sierra' despite numerous bug reports over
the intervening years.

Previous versions of MailFlow advised users to disable SIP or wait for
the bug to be fixed, but this has been inconveniencing users for far too
long. Apple's attention is clearly focused elsewhere, perhaps on vital
cosmetic trivia.

The installer crashes because Apple's bundled py2app copies a file from
the system Python.framework as it builds the plugin bundle, and attempts
to preserve file flags including the SIP 'restricted' flag. The crash
can be avoided by replacing shutil.copystat with a version that
preserves mode and utime but not file flags.
c4f0c922 — Chris Webb 3 years ago
Update MailFlow for Mail 11.0 and macOS 10.13 'High Sierra'

None of the long-standing problems MailFlow addresses have been fixed
upstream. System Integrity Protection still carelessly breaks py2app two
years after the problem was reported.
8fc614c1 — Chris Webb 4 years ago
Update MailFlow for Mail 10.0 and macOS 10.12 'Sierra'

Clear up the usual breakage from Apple's annual rearranging of
deckchairs. None of the long-standing problems MailFlow addresses have
been fixed upstream. System Integrity Protection still carelessly breaks
py2app a year after the problem was reported.
bdbb7407 — Chris Webb 4 years ago
Avoid using 8-bit encoding for binary attachments

Fix a bug which forced an 8-bit encoding for binary attachments as well
as text/plain parts, corrupting any NUL bytes.
ed68874e — Chris Webb 5 years ago
Preserve all trailing newlines in text/plain parts

Fix a bug which removed the last trailing newline from every text/plain
part when reflowing the text. (This was most visible when attachments
were included right after the last line of the message body.)
41d57a92 — Chris Webb 5 years ago
Factor out class/category lookup and simplify swizzle syntax

Introduce a wrapper to look up classes/categories by name, and modify
the swizzle decorator to take the name of the class to be patched rather
than the class itself.
9251b39b — Chris Webb 5 years ago
Correctly fix attribution line for replies triggered by AppleScript

When a reply is triggered by AppleScript, the message type is 8 rather
than 1 (for standard reply) or 2 (for standard reply-to-all). Fix the
attribution line in all three cases.
def0de8c — Chris Webb 5 years ago
Prevent Increase/Decrease Indentation from removing attachments

The plain text Increase/Decrease Indentation operations detect blank
lines using selectedDOMRange().stringValue().isspace(). This fails to
spot paragraphs containing only whitespace, images and attachments,
which are then deleted. Detect these cases more carefully to avoid the
inadvertent loss of images and attachments.
ac1f2d39 — Chris Webb 5 years ago
Update MailFlow for Mail 9.0 and OS X 10.11 'El Capitan'

The DocumentEditor class has been replaced by ComposeViewController and
the cursor now needs to be positioned in the show selector instead of
finishLoadingEditor. Rework the attribution clean-up code to fit this
brave new world.

The version of py2app shipping with OS X 10.11 is broken by the new
System Integrity Protection feature. Document this with instructions for
disabling 'rootless' mode and removing the offending file flags until
the system py2app is properly fixed.
8e8037c3 — Chris Webb 5 years ago
Fix Increase/Decrease Indentation for plain text messages

Mail has built-in operations to increase and decrease the indentation
level of lines or blocks of text. They use <blockquote> elements when
composing HTML messages but are not available in plain text mode.

Extend these operations to insert or remove two-space indentation at the
start of lines when composing plain text messages. This is particularly
useful when generating flowed text as indented text is not reflowed.
2b33defb — Chris Webb 5 years ago
Fix rendering of indented lines in text/plain parts

Mail has a rendering bug which drops one leading space from indented
lines in text/plain messages. As well as interfering with column
alignment, this also corrupts inline patches which could otherwise be
copied and pasted directly into patch or git apply.

When converting the text/plain part to HTML for display in a WebView,
all but the first leading space is rendered as '&nbsp;' so, for example,
a line '  foo' becomes '<BR> &nbsp;foo'. However, WebKit will then
display this as ' foo' not '  foo'.

To work around this, swizzle the decodeTextPlainWithContext: selector of
MCMimePart to translate a space following a '<BR>' (or at the start of
the rendered fragment) into '&nbsp;' just before returning the HTML for
rendering. Mail always translates line-breaks to '<BR>', not '<br>' or
'<BR />'. A case-sensitive literal match is therefore used for speed,
minimising the impact on UI latency.
9ab8f352 — Chris Webb 5 years ago
Use Option key to select inline forwarding format
b79fa55b — Chris Webb 5 years ago
Disable format=flowed if Option key held whilst sending

It is easy to forget to toggle flowed text back on after disabling it
using the Flow Text option in the Format menu, potentially leading to
unintended and embarrassing unwrapped messages. Even after sending,
these are not obvious within Mail as it will automatically wrap long
lines in the message viewer.

Replace the dangerously persistent disabled/enabled state implemented by
the 'Flow Text' menu item with a momentary Option-key modifier to
disable format=flowed whilst sending.
7ca6def1 — Chris Webb 5 years ago
Import initial versions of MailFlow and pbmbox