{"id":28526437,"url":"https://github.com/stephbu/mailboxmanager","last_synced_at":"2025-07-05T18:31:54.743Z","repository":{"id":139556075,"uuid":"417002735","full_name":"stephbu/MailboxManager","owner":"stephbu","description":"Emulate some neat Outlook email features that gmail sorely lacks","archived":false,"fork":false,"pushed_at":"2023-10-23T16:19:30.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T11:52:34.672Z","etag":null,"topics":["gmail","gmail-api","gmailapi","outlook"],"latest_commit_sha":null,"homepage":"","language":"Go","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/stephbu.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}},"created_at":"2021-10-14T05:42:00.000Z","updated_at":"2023-03-23T06:47:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"179e1693-6850-4554-b2ed-fa2aa4e8cf3f","html_url":"https://github.com/stephbu/MailboxManager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stephbu/MailboxManager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephbu%2FMailboxManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephbu%2FMailboxManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephbu%2FMailboxManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephbu%2FMailboxManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephbu","download_url":"https://codeload.github.com/stephbu/MailboxManager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephbu%2FMailboxManager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263784650,"owners_count":23510950,"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":["gmail","gmail-api","gmailapi","outlook"],"created_at":"2025-06-09T11:37:19.196Z","updated_at":"2025-07-05T18:31:54.737Z","avatar_url":"https://github.com/stephbu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mailbox Manager\n\n## Purpose\n\nEmulate some neat Outlook email features that gmail sorely lacks\n- Keep Last 'n'\n- Retention 'n' Days\n\n## How It Works\nCreate custom labels, then create filters to apply labels to emails as they arrive\n\nExpected format of labels is as follows:\n```\n- ManagedLabels/KeepDaysX\n- ManagedLabels/KeepLastX\n```\nFor example, to keep the last 10 mails from a specific sender,\nyou'd apply the label called:\n\n```ManagedLabels/KeepLast10```\n\nOr to keep a mail in your inbox for up to a week before being deleted,\nyou'd apply a label called\n\n```ManagedLabels/KeepDays7```\n\nEach time you run the code, it will comb through recognized managed\nlabels, identifying mails that should be retained, and those out of retention scope.\nThose out of scope will be deleted.\n\n## Permissions\n\nIt requires full ```mail.google.com``` access permissions in order to delete mails.\n\n## Getting Started\n\n### Code\nYou'll need some Go Tools, VSCode and Goland are my current favorites.\nClone this repo somewhere convenient.\n\n### Secrets\nYou'll need to provide a set of secrets in order to get started with the Gmail API.\nThe code needs a set of credentials and a token stored in the secrets folder.\nThe secrets folder is currently not committed to this repo, and should not be committed.\n\n### Secrets Folder\nThe code assumes that secrets are stored in\n```\n\u003ccode\u003e/secrets/\n```\n\n#### Credentials File\n1. Sign into the Google Cloud API dashboard using your Gmail account\n2. Create a project called \"MailboxManager\" in the Google Cloud Platform website.\n3. Create an OAuth 2.0 credential in the API Dashboard\nhttps://console.cloud.google.com/apis/dashboard\n4. Download this credential and store it in ```\u003ccode\u003e/secrets/credentials.json```\n\n#### Token\nAssuming that the credentials file exists, this token is generated when the application is first run,\ncopy and paste the full URL from the console into a browser.  You will be prompted to log in, accept the access requested, in return\nyou will get a token string.  Copy and paste this token string into the running application console, and press enter to save the token.\n(written to ```\u003ccode\u003e/secrets/token.json```)\n\nThis token **will** periodically expire.  Delete the file, re-initiate the process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephbu%2Fmailboxmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephbu%2Fmailboxmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephbu%2Fmailboxmanager/lists"}