{"id":38346147,"url":"https://github.com/arachsys/mailflow","last_synced_at":"2026-01-17T03:03:36.084Z","repository":{"id":3970064,"uuid":"41268085","full_name":"arachsys/mailflow","owner":"arachsys","description":"Flowed text plugin for Apple Mail","archived":false,"fork":false,"pushed_at":"2023-02-16T21:25:59.000Z","size":44,"stargazers_count":68,"open_issues_count":1,"forks_count":13,"subscribers_count":10,"default_branch":"master","last_synced_at":"2023-03-24T05:56:21.757Z","etag":null,"topics":["email","macos","plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arachsys.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-08-23T21:27:46.000Z","updated_at":"2023-07-05T15:35:16.040Z","dependencies_parsed_at":"2023-07-06T10:46:06.606Z","dependency_job_id":null,"html_url":"https://github.com/arachsys/mailflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/arachsys/mailflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arachsys%2Fmailflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arachsys%2Fmailflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arachsys%2Fmailflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arachsys%2Fmailflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arachsys","download_url":"https://codeload.github.com/arachsys/mailflow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arachsys%2Fmailflow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492597,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","macos","plugin"],"created_at":"2026-01-17T03:03:35.979Z","updated_at":"2026-01-17T03:03:36.055Z","avatar_url":"https://github.com/arachsys.png","language":"Python","readme":"MailFlow\n========\n\nMailFlow is a plugin for Apple Mail on macOS 10.12 to 12.x, fixing it to\nemit RFC2646 format=flowed plain text messages and taming its enthusiasm for\nquoted-printable transfer encoding. Quoting and attribution when replying is\nalso improved, and a long-standing bug in the display of plain text messages\nis fixed.\n\nMail was once quite a good 'net citizen. It could be configured to generate\nplain text email, and would do so with the text neatly wrapped at 76\ncolumns. In addition, it used the RFC2646 format=flowed extension to\nindicate that these wrapped paragraphs could be reflowed. Thus mailing list\narchives and traditional mail clients saw readable 80-column text without\nnoisy encoding, but more sophisticated readers could re-fill the paragraphs\nto suit the display width.\n\nUnfortunately, Mail is poorly maintained and has declined in quality over\nrecent years, with many bugs introduced and incompetent design choices made.\nCurrent releases have ditched format=flowed for plain text parts, instead\nopting to emit each paragraph as a single long line. If this is longer than\n77 characters, the text is mangled with a quoted-printable transfer\nencoding. The resulting email leaves a very visible mess in mailing list\narchives on the web, as well as drawing understandable ire from recipients\nwith traditional unix mail clients.\n\nFortunately, even if Mac users find themselves attracted to Apple Mail for\nits convenient reading interface and good platform integration, all is not\nlost. Mail has been furnished with a plugin interface, albeit an\nundocumented one, and MailFlow hooks into this to improve the situation.\n\n\nCompatibility\n-------------\n\nMailFlow is currently compatible with Apple Mail 10.0 to 15.x included in\nmacOS 10.12 (Sierra) to 12.x (Monterey).\n\nIt does not yet support Mail 16.x included in macOS 13.x (Ventura). This\nmakes major changes to the message editor, requiring non-trivial fixes to\nthe way MailFlow hooks into the composer. In particular, it is no longer\nobvious how to access the message DOM tree, which MailFlow relies on to\ncorrect attribution lines, detect plain text mode and extend indentation.\nThe format=flowed transformation of outbound messages still works fine.\n\nI do not use macOS apart from maintaining MailFlow and MailWrap, and only\nhave occasional access to machines running the most recent versions. As far\nas I can tell, the class-dump utility which I relied on to develop MailFlow\nis also broken by the latest OS release. I would welcome input from anyone\nwith better insight into the Mail.app changes, or just with more patience\nto reverse-engineer its internals once again. Please do get in touch with\nChris Webb \u003cchris@arachsys.com\u003e.\n\n\nInstallation\n------------\n\nTo install, clone the git repository or unpack the source tar.gz, change to\nthe source directory and run 'python install.py' or 'python3 install.py'.\nYour terminal will need access to ~/Library/Mail/Bundles/ which you can\ngrant in the Privacy and Security tab of System Settings.\n\nThe installer and plugin work with both the system Python 2.7 and more\nrecent Python 3.x, but py2app and pyobjc are required. The installer will\nprompt you to install these with pip/pip3 if they can't be found.\n\nPlugin bundles contain a list of UUIDs identifying versions of Mail with\nwhich they are compatible. The install.py script extracts the correct UUID\nfrom the installed version of Mail, generates a MailFlow.bundle to match,\nand installs it in ~/Library/Mail/Bundles/. You will need to quit and\nrelaunch Mail for the plugin to be registered.\n\nOn macOS 10.14 and later, the plugin must be explicitly enabled in Mail\nPreferences or Settings. Choose 'Manage Plug-ins...' from the General tab,\ntick MailFlow.mailbundle, then choose 'Apply and Restart Mail'.\n\nOn macOS 11.0 and later, the plugin also needs to be ad-hoc signed and\nauthorised before it will work. The installer will run\n\n  codesign -f -s - ~/Library/Mail/Bundles/MailFlow.mailbundle\n  spctl --add --label MailFlow ~/Library/Mail/Bundles/MailFlow.mailbundle\n  spctl --enable --label MailFlow\n\nfor you, but spctl will require your password to allow the changes. Many\nthanks to A. Wilcox (awilfox) for providing these signing instructions on\ntheir Cat Fox Life blog.\n\nIf the sandbox doesn't allow Mail.app to read the directory where your\nPython is installed, you may need to change 'semi_standalone' to False in\nthe setup options in install.py. This issue doesn't affect /usr/bin/python\nor /usr/bin/python3, but has been reported with Homebrew Python running\nfrom /opt/homebrew/bin/python3 and /opt/homebrew/Cellar/python@3.x/.\n\nIf you use the system Python 2.7 on macOS 11.0 or later, you will need to\nset SYSTEM_VERSION_COMPAT=0 in the environment when running install.py:\n\n  SYSTEM_VERSION_COMPAT=0 /usr/bin/python install.py\n\nWithout this, a horrible Apple hack will cause the installer to detect the\nOS version incorrectly as 10.16. It aborts with a warning if that happens.\n\nSometimes when Mail is updated, its compatibility UUID changes. Mail will\nthen disable plugins, moving them from 'Bundles/' to 'Bundles (Disabled)/'.\nThe user is notified when this happens, and it is sufficient to simply run\nthe install.py script again. The old disabled bundle will be cleared away,\nand a new one built and installed to match the new version of Mail.\n\n\nFeatures\n--------\n\nMost of MailFlow's functionality should be transparent to a Mail user unless\nthe raw source of sent messages is examined. Its primary feature is to break\nparagraphs into reflowable lines in RFC2646 format=flowed format and disable\nquoted-printable transfer encoding for plain text email.\n\nIn outbound plain text messages, lines are broken at word boundaries to wrap\nthe text to 76 columns wide, and a trailing space is added wherever a line\nhas been broken. Where a line to be broken is quoted, the continuation line\nis quoted to the same level. Finally, to signal the message has been flowed,\nthe parameters format=flowed and delsp=yes are added to the text/plain\ncontent-type. The result is a visually clean plain text message, correctly\nwrapped for 80 column displays, but clients aware of the format=flowed\nextension can spot the trailing spaces, reassemble paragraphs and reflow\nthem to fit displays of differing widths. This is especially useful for\nmobile devices.\n\nUnlike Apple's original format=flowed implementation, MailFlow will never\nbreak a line within a word, even if that word is longer than 76 characters.\nThis was typically an issue with long URLs pasted into messages: breaking\nthese to fit an 80-column display usually causes more problems than it\nsolves, and some format=flowed aware clients do not fully support the\ndelsp=yes modifier needed to reassemble them. However, as with Apple's\noriginal implementation, MailFlow implements space stuffing for unquoted\nlines beginning with ' ' or 'From '.\n\nLines indented with whitespace are not flowed, whether or not they are\nquoted, and any trailing whitespace is removed to avoid clients from trying\nto reflow them. This provides a convenient way to include non-reflowable\ncontent such as quotes, code samples, aligned columns or ASCII art whilst\ncomposing a plain text message.\n\nFor convenience when indenting text blocks, the built-in Increase/Decrease\nIndentation operations are extended to work on plain text messages. These\nwill insert or remove two spaces at the start of the current line or all\nlines overlapping the current selection.\n\nFlowed format is not appropriate for some messages, such as those containing\ninline patches. To disable the use of flowed text for an individual message,\nhold down the Option key when clicking on the Send button in the toolbar, or\nwhen selecting Send from the Message menu. MailFlow will still restrict\nunnecessary use of quoted-printable even when format=flowed is disabled.\n\nBy default, Mail uses a quoted-printable transfer encoding for text/plain\nparts whenever they contain non-ASCII characters or a line longer than 77\ncharacters. MailFlow relaxes this behaviour for text/plain, using a 7-bit\ntransfer encoding for plain ASCII and an 8-bit transfer encoding otherwise,\nprovided the lines do not exceed the 998 column limit imposed by SMTP. Note\nthe outbound mail server must support the 8BITMIME ESMTP extension\n(RFC1653/RFC6152) but all modern SMTP servers are fine with this.\n\nMailFlow will trim the excessively verbose attribution line Mail inserts\nwhen composing a reply, i.e.\n\n  On 8 Apr 2014, at 10:08:34, Chris Webb \u003cchris@arachsys.com\u003e wrote:\n\nbecomes\n\n  Chris Webb \u003cchris@arachsys.com\u003e wrote:\n\nSince version 8.0, Mail has a bug which causes the attribution line to be\nquoted as if it were part of the original message. MailFlow will also fix\nthis whilst trimming the attribution line.\n\nMailFlow makes it easier to forward messages as proper MIME attachments\ninstead of quoting them inline. Mail has always supported MIME forward but\nrelegated it to the Message menu without a shortcut or toolbar button,\ninstead encouraging ugly inline forward. MailFlow reconfigures the standard\nforward buttons, keyboard shortcut and menu item to use MIME.\n\nTo override this and forward a message inline, hold down the Option key when\nclicking on the Forward button in the toolbar or when selecting Forward from\nthe Message menu.\n\nFinally, MailFlow addresses a very long-standing bug in Mail, which drops\none leading space from every indented line of a plain text message in the\nmessage viewer. When converting the text/plain part to HTML for display in a\nWebView, all but the first leading space is rendered as '\u0026nbsp;' so, for\nexample, a line '  foo' becomes '\u003cBR\u003e \u0026nbsp;foo'. However, WebKit will then\ndisplay this as ' foo' not '  foo'.\n\nTo work around this bug, MailFlow translates a space following a '\u003cBR\u003e' (or\nat the start of the message) into '\u0026nbsp;' before a plain text part is\nrendered in a WebView.\n\n\nConfiguration\n-------------\n\nMailFlow reads two preferences from the com.apple.mail domain. These can be\nset at the command line with the macOS defaults command:\n\n  defaults write com.apple.mail MailFlow -dict-add FixAttribution -bool false\n  defaults write com.apple.mail MailFlow -dict-add FixAttribution -bool true\n    - configure MailFlow to strip the verbose date and time information\n      from the attribution line when composing a reply. The default is on.\n\n  defaults write com.apple.mail MailFlow -dict-add FlowWidth -int NN\n    - break lines at a width of NN characters when flowing text. The\n      default is 76. Set to 0 to disable format=flowed but still restrict\n      unnecessary use of quoted-printable.\n\n\npbmbox\n------\n\nFor command-line users, the MailFlow distribution also includes a small\nutility, pbmbox. When messages are selected and copied in Mail, they are\nadded to the clipboard as RFC822MessageDatasPboardType objects. pbmbox\ndecodes these objects and emits the messages in unix mbox format on stdout.\n\nTo install, copy it to a directory in your PATH and make it executable:\n\n  sudo install -m 0755 pbmbox.py /usr/local/bin/pbmbox\n\nA typical use is importing a patch series from email into a git repository.\nSelect the messages in Mail, copy them with Command-C, and then run\n\n  pbmbox | git am\n\nwithin the repository.\n\nBy default, the mboxrd format is used: lines beginning with /\u003e*From / are\nquoted with one additional leading '\u003e'. This encoding avoids corruption of\nmessages and is always reversible. If the -n or --no-quote-from option is\ngiven, pbmbox will not attempt to quote 'From  ' lines. This is sometimes\nuseful for simple command-line handling of a single message, where no\nambiguity can result from an unquoted 'From '.\n\n\nCopying\n-------\n\nThis software was written by Chris Webb \u003cchris@arachsys.com\u003e and is\ndistributed as Free Software under the terms of the MIT license in COPYING.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farachsys%2Fmailflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farachsys%2Fmailflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farachsys%2Fmailflow/lists"}