{"id":25905444,"url":"https://github.com/stevekm/mutt-py","last_synced_at":"2025-06-28T01:33:31.520Z","repository":{"id":94518010,"uuid":"88377272","full_name":"stevekm/mutt-py","owner":"stevekm","description":"A Python wrapper script for emailing with mutt","archived":false,"fork":false,"pushed_at":"2017-12-31T10:50:15.000Z","size":7,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T21:24:56.238Z","etag":null,"topics":["attachment","email","mutt","python","python-wrapper-script"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevekm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-04-15T22:21:27.000Z","updated_at":"2022-11-10T20:59:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"b147370c-f77b-4ccc-be19-fe971ed92d0f","html_url":"https://github.com/stevekm/mutt-py","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stevekm/mutt-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevekm%2Fmutt-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevekm%2Fmutt-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevekm%2Fmutt-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevekm%2Fmutt-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevekm","download_url":"https://codeload.github.com/stevekm/mutt-py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevekm%2Fmutt-py/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262361524,"owners_count":23299081,"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","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":["attachment","email","mutt","python","python-wrapper-script"],"created_at":"2025-03-03T05:15:10.679Z","updated_at":"2025-06-28T01:33:31.505Z","avatar_url":"https://github.com/stevekm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mutt-py\nA Python wrapper script for emailing with the `mutt` [program](http://www.mutt.org/).\n\nThis script will let you easily send a message from your remote server with multiple files attached, avoiding the need to download files to your local machine in order to email them. \n\n# Usage\nThe only required flag is `-r` to specify a list of email recipients. Other flags can be provided, to fill in the subject line, body message, and reply-to address. Any extra positional arguments are treated as files to be attached. \n\n```bash\n$ ./mutt.py -s \"Merry Christmas!\" -r \"mom@internets.com, dad@internets.com\" -rt \"steve@internets.com\" -m \"Merry Christmas, Mom and Dad! Love, Steve\" christmas_card.txt presents.txt\n```\nOutput:\n```\nEmail command is:\n\nexport EMAIL=\"steve@internets.com\"\n\nmutt -s \"Merry Christmas\" -a \"christmas_card.txt\" -a \"presents.txt\"  -- \"mom@internets.com, dad@internets.com\" \u003c\u003cE0F\nMerry Christmas, Mom and Dad! Love, Steve\nE0F\n\nRunning command, sending email...\n```\n\nThe script will run the `mutt` command as shown, sending the email with specified attachments and recipients. \n\nThis can be combined with the `find` command to search your system for desired files to be emailed:\n```\n$ find . -maxdepth 1 -type f | xargs ./mutt.py -r \"kellys04@nyumc.org\"\nEmail command is:\n\nexport EMAIL=\"\"\n\nmutt -s \"[mutt.py]\" -a \"./README.md\" -a \"./christmas_card.txt\" -a \"./presents.txt\" -a \"./mutt.py\"  -- \"kellys04@nyumc.org\" \u003c\u003cE0F\n~ This message was sent by the mutt.py email script ~\nE0F\n\nRunning command, sending email...\n```\n\n# Notes\n\nCurrently, newline characters are not rendered properly when using the `-m` argument. If your message requires newlines, then consider using the `-mf` argument to send the contents of a file as the message instead. \n\n```\n$ cat message.txt\nThis is the email message\nI wrote this message\nto be sent in the email\n- Stephen\n\n$ ./mutt.py -r \"kellys04@nyumc.org\" -mf message.txt\nEmail command is:\n\nexport EMAIL=\"\"\n\nmutt -s \"[mutt.py]\"  -- \"kellys04@nyumc.org\" \u003c\u003cE0F\nThis is the email message\nI wrote this message\nto be sent in the email\n- Stephen\n\n\nE0F\n\nRunning command, sending email...\n```\n\nIf you need to generate the contents of such a message dynamically, consider using a heredoc for message generation as well:\n\n```bash\nmessage_file=\"message2.txt\"\nfoo=\"fooooo\"\nbar=\"baaaar\"\n\ncat \u003e \"$message_file\" \u003c\u003cE02\n$foo\n$bar\nE02\n\n./mutt.py -r \"kellys04@nyumc.org\" -mf \"$message_file\"\n```\n\n```\nEmail command is:\n\nexport EMAIL=\"\"\n\nmutt -s \"[mutt.py]\"  -- \"kellys04@nyumc.org\" \u003c\u003cE0F\nfooooo\nbaaaar\n\nE0F\n\nRunning command, sending email...\n```\n\n## Why `mutt-py`?\n\nWhile Python does have a built in email library, `mutt` is a very robust program that requires less configuration to use and is easily available on most Linux systems. On OS X, you can download it with homebrew with the command `brew install mutt`. \n\nThe main drawback to `mutt`, and the reason for this script, is that `mutt`'s required syntax is difficult to expand dynamically for variable numbers of file attachments. \n\n# Software Requirements\nthis script was developed \u0026 tested with the following:\n- Python 2.6, 2.7, 3.4.3\n- bash version 4.1.2\n- Mutt 1.5.20\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevekm%2Fmutt-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevekm%2Fmutt-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevekm%2Fmutt-py/lists"}