{"id":20631060,"url":"https://github.com/gfarrell/email-scripts","last_synced_at":"2026-04-17T18:33:22.099Z","repository":{"id":142037714,"uuid":"163875646","full_name":"gfarrell/email-scripts","owner":"gfarrell","description":"Scripts for dealing with emails en masse","archived":false,"fork":false,"pushed_at":"2019-01-02T18:35:54.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-21T09:06:30.326Z","etag":null,"topics":[],"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/gfarrell.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}},"created_at":"2019-01-02T18:30:15.000Z","updated_at":"2019-01-02T18:35:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"f143c155-6845-482a-924c-42980524dc82","html_url":"https://github.com/gfarrell/email-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gfarrell/email-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2Femail-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2Femail-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2Femail-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2Femail-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfarrell","download_url":"https://codeload.github.com/gfarrell/email-scripts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2Femail-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31940934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"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":[],"created_at":"2024-11-16T14:10:43.110Z","updated_at":"2026-04-17T18:33:22.084Z","avatar_url":"https://github.com/gfarrell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Email Management Scripts\n\n    $ python cli.py --help\n\n    Usage: cli.py [OPTIONS] COMMAND [ARGS]...\n\n    Options:\n      -h, --host TEXT       IMAP server  [required]\n      -u, --user TEXT       username  [required]\n      -p, --password TEXT   password  [required]\n      --debug / --no-debug\n      --help                Show this message and exit.\n\n    Commands:\n      move   moves emails from one folder to another\n\n## MOVE emails between folders\n\nIf you need to move emails from one folder to another in a mailbox, one\nway is to use a mail client, download all the emails, then drag them to\nthe other folder. I suspect most mail clients will use something like\n`COPY` ... `EXPUNGE`, but even if they don't, downloading all those\nmessage headers is a little inefficient (especially as the client will\nhave to resynchronise.\n\nInstead, you can use this move script, which uses the IMAP4 `MOVE`\ncommand. I used this to move around 30k messages from one folder to\nanother when I migrated from Google Mail to Runbox so it works pretty\nwell, and inserts a 100µs rest every 250 messages anyway.\n\nUnfortunately I haven't found a reliable way to operate over a range of\n`UID`s, so this executes the `MOVE` on a per-message basis, which makes\nit a little slow. It reports progress every 250 messages.\n\n### Usage\n\nFor example, when moving emails from Gmail's \"All Mail\" folder, to my newly\ncreated \"Archives\" folder:\n\n    $ python cli.py -h imap.server.com -u me move -f \"[Gmail].All Mail\" -t \"Archives\"\n\nLeaving out the `-p` password option causes the programme to prompt you for a\npassword (which is better than leaving it in plaintext).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfarrell%2Femail-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfarrell%2Femail-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfarrell%2Femail-scripts/lists"}