{"id":20746912,"url":"https://github.com/johnagan/gmail-labeler","last_synced_at":"2025-08-12T23:05:35.835Z","repository":{"id":66093400,"uuid":"47499655","full_name":"johnagan/gmail-labeler","owner":"johnagan","description":"Label and filter Gmail threads using basic RegEx against the email body or headers.","archived":false,"fork":false,"pushed_at":"2015-12-06T15:09:01.000Z","size":11,"stargazers_count":55,"open_issues_count":1,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-05T13:04:43.891Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"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/johnagan.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}},"created_at":"2015-12-06T14:21:02.000Z","updated_at":"2025-05-04T11:14:32.000Z","dependencies_parsed_at":"2023-02-19T23:00:59.683Z","dependency_job_id":null,"html_url":"https://github.com/johnagan/gmail-labeler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johnagan/gmail-labeler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnagan%2Fgmail-labeler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnagan%2Fgmail-labeler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnagan%2Fgmail-labeler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnagan%2Fgmail-labeler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnagan","download_url":"https://codeload.github.com/johnagan/gmail-labeler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnagan%2Fgmail-labeler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270149345,"owners_count":24535728,"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-08-12T02:00:09.011Z","response_time":80,"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":"2024-11-17T08:09:52.047Z","updated_at":"2025-08-12T23:05:35.780Z","avatar_url":"https://github.com/johnagan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gmail Labeler\n\nLabel and filter Gmail threads using basic RegEx against the email body or headers.\n\n## Configuration\n\n#### Filters Options\n\n```javascript\nvar filters = [\n  // star emails deliveredto user@domain.com\n  { name: 'user emails', match: /deliveredto:user@domain.com/, star: true },\n  \n  // organize by list name\n  { match: /(?:List-ID:\\s(.+?)\\s\u003c)/, archive: true },\n\n  // label all emails with \"bank\" in the subject as \"finance\" and mark as read\n  { name: 'finance', subject: 'bank', markRead: true },\n];\n```\n\n* `name` - The label name to apply when matched. This can also be nested by adding slashes `folder/name`. If no name is set, it will use the first RegEx selector result (.+?)\n* `match` - The RegEx to match against. This searches the entire raw contents of the email, including the header. Include a RegEx selector to return dynamic label names (.+?)\n* `subject` - Helper to search the subject for text\n* `archive` - true/false to archive the matching emails\n* `star` - true/false to star the matching emails\n* `markRead` - true/false to mark the matching emails as read\n\n## From\n\n```javascript\nvar from = [\n  \"from:email@domain.com\",\n  \"list:subscription.domain.com\"\n];\n```\n\nThis can be any combination of [Gmail filters](https://support.google.com/mail/answer/7190?hl=en) to apply the labels against.\n\n## Installation\n\n_You'll need to enable [Google App Scripts](https://script.google.com) in your Google Drive account_\n\n\n#### Create a new Google App Script\n\n![](https://cloud.githubusercontent.com/assets/35968/11613861/188b8622-9be5-11e5-812c-837f0f585d48.png)\n\n#### Paste the labeler.gs contents into the new file and Save\n\n![](https://cloud.githubusercontent.com/assets/35968/11613887/bddbaabc-9be5-11e5-81e9-7f6f2e897ac1.png)\n\n#### After savings, create a new trigger\n\n![](https://cloud.githubusercontent.com/assets/35968/11613897/eb3a119c-9be5-11e5-8f3c-728a00d693a6.png)\n\n#### Run the `labeler` function every minute\n\n![](https://cloud.githubusercontent.com/assets/35968/11613896/eb399d16-9be5-11e5-8292-1ff11201da1e.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnagan%2Fgmail-labeler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnagan%2Fgmail-labeler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnagan%2Fgmail-labeler/lists"}