{"id":29866526,"url":"https://github.com/ficd0/mail-utils","last_synced_at":"2025-07-30T12:39:41.092Z","repository":{"id":305798557,"uuid":"963583305","full_name":"ficd0/mail-utils","owner":"ficd0","description":"Mirrored from https://git.sr.ht/~ficd/mail-utils","archived":false,"fork":false,"pushed_at":"2025-05-25T20:33:29.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-22T04:35:22.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://git.sr.ht/~ficd/mail-utils","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/ficd0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-09T22:44:45.000Z","updated_at":"2025-05-25T20:33:32.000Z","dependencies_parsed_at":"2025-07-22T04:35:23.468Z","dependency_job_id":"ead471be-72a9-4bf8-88fc-b8cd9aad7880","html_url":"https://github.com/ficd0/mail-utils","commit_stats":null,"previous_names":["ficd0/mail-utils"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ficd0/mail-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficd0%2Fmail-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficd0%2Fmail-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficd0%2Fmail-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficd0%2Fmail-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ficd0","download_url":"https://codeload.github.com/ficd0/mail-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficd0%2Fmail-utils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267867868,"owners_count":24157368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-07-30T12:39:40.015Z","updated_at":"2025-07-30T12:39:41.084Z","avatar_url":"https://github.com/ficd0.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# email utils\n\nThis repository is part of my\n[utilities collection](https://sr.ht/~ficd/utils/). It contains scripts that\nimprove the experience of reading and writing email with aerc and Helix.\n\n| Script                | Purpose                                                                              |\n| --------------------- | ------------------------------------------------------------------------------------ |\n| `format.py`           | Reflow and hard-wrap emails, preserving quotes, code blocks, lists, and indentation. |\n| `paste-attachment.sh` | Utility for attaching files to emails in `aerc` from the user clipboard.             |\n\n## Format\n\nBy default, this script accepts its input on `stdin` and prints to `stdout`.\nThis makes it well suited for use with an editor like Helix. It has no\ndependencies besides the standard Python interpreter, and was written and tested\nagainst Python 3.13.2.\n\n**Features:**\n\n- Wraps emails at specified columns.\n- Automatically reflows paragraphs.\n- Squashes consecutive paragraph breaks.\n- Preserves:\n  - Any long word not broken by spaces (e.g. URLs, email addresses).\n  - Quoted lines.\n  - Indented lines.\n  - Lists.\n  - Markdown-style code blocks.\n  - Usenet-style signature block at EOF.\n  - Sign-offs.\n\n**Usage:**\n\n```\nusage: format.py [-h] [-w WIDTH] [-b] [--no-replace-whitespace] [--no-reflow]\n                 [--no-signoff] [--no-signature] [--no-squash] [-i INPUT] [-o OUTPUT]\n\nFormatter for plain text email.\n\"--no-*\" options are NOT passed by default.\n\noptions:\n  -h, --help            show this help message and exit\n  -w, --width WIDTH     Text width for wrapping. (default: 74)\n  -b, --break-long-words\n                        Break long words while wrapping. (default: False)\n  --no-replace-whitespace\n                        Don't normalize whitespace when wrapping.\n  --no-reflow           Don't reflow lines.\n  --no-signoff          Don't preserve signoff line breaks.\n  --no-signature        Don't preserve signature block.\n  --no-squash           Don't squash consecutive paragraph breaks.\n  -i, --input INPUT     Input file. (default: STDIN)\n  -o, --output OUTPUT   Output file. (default: STDOUT)\n```\n\n## Paste Attachment\n\nThis script is meant to be used with `aerc`'s `:menu` and `:attach` command.\nPlease see the example below:\n\n```ini\np = :menu -c 'paste-attachment.sh' :attach\u003cEnter\u003e # Paste attachment\n```\n\nThe above command will call the script in an embedded terminal through which you\nmay interact with it. You will be prompted for confirmation before any files are\nwritten or attached to the email.\n\nWhen invoked, it will query the user's clipboard via `wl-clipboard` If the type\nis _not_ `text/plain`, the script will try to guess its extension and prompt the\nuser for a filename. The file will be written to a temporary directory and its\npath printed to `stdout`.\n\nIf the clipboard contains `text/plain` that is a valid file path in either UNIX\nor URI format, the script will process the path and print it to `stdout` in a\nformat `aerc` will accept.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fficd0%2Fmail-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fficd0%2Fmail-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fficd0%2Fmail-utils/lists"}