{"id":29182515,"url":"https://github.com/unknwon/gmail-blade","last_synced_at":"2025-07-01T20:06:38.084Z","repository":{"id":302159414,"uuid":"1010193084","full_name":"unknwon/gmail-blade","owner":"unknwon","description":"A Gmail sidecar for advanced filtering","archived":false,"fork":false,"pushed_at":"2025-06-30T21:57:26.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-30T22:32:46.432Z","etag":null,"topics":["gmail","go"],"latest_commit_sha":null,"homepage":"","language":"Go","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/unknwon.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-28T14:51:59.000Z","updated_at":"2025-06-30T21:57:30.000Z","dependencies_parsed_at":"2025-06-30T22:42:57.178Z","dependency_job_id":null,"html_url":"https://github.com/unknwon/gmail-blade","commit_stats":null,"previous_names":["unknwon/gmail-blade"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unknwon/gmail-blade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgmail-blade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgmail-blade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgmail-blade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgmail-blade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unknwon","download_url":"https://codeload.github.com/unknwon/gmail-blade/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgmail-blade/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263029214,"owners_count":23402354,"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","go"],"created_at":"2025-07-01T20:06:36.951Z","updated_at":"2025-07-01T20:06:38.064Z","avatar_url":"https://github.com/unknwon.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch3\u003eGmail Blade\u003c/h3\u003e\n\u003c/div\u003e\n\n## What?\n\nGmail Blade is a sidecar with advanced and precise filtering for your Gmail account. Utilizing the expressiveness of [`expr-lang/expr`](https://expr-lang.org/) to fully customize your Gmail experience. Make Gmail great again!\n\n## Why?\n\nI am an inbox-zero guy, I rely on emails for all my notifications because the nature of emails is working asynchronously. I absolutely hate red dots and I disabled all of them. Unfortunately, native Gmail filters do not support precise filtering, and works more like a \"search engine\" over the emails, with fuzz matches, that creates lots of false positives. The speed of the email processing directly impact my productivity.\n\nWhy I have waited so long? Every side project needs a kick, and [Sourcegraph Amp](https://ampcode.com/?ref=github-unknwon) did this one for me, I want to try it for a small project from scratch, and here it is.\n\n## How?\n\n### Installation\n\n```zsh\ngo install unknwon.dev/gmail-blade/cmd/gmail-blade\n```\n\n### Configuration\n\nA YAML configuration file is expected (default `gmail-blade.yml` in the working directory), and below is an example:\n\n```yaml\ncredentials:\n  # Your Gmail email address\n  username: \"joe@acme.com\"\n  # Generate yours at: https://myaccount.google.com/apppasswords\n  # You can also use the name of an environment variable, or leave empty to be prompted at start.\n  password: \"$GMAIL_PASSWORD\"\n\nfilters:\n  - name: \"Delete GitHub backport notifications\"\n    condition: |\n      \"notifications@github.com\" in message.from and message.subject contains \"] [Backport \"\n    action: delete\n    halt-on-match: true\n  - name: \"Delete GitHub CI notifications\"\n    condition: |\n      \"ci_activity@noreply.github.com\" in message.cc\n    action: move to \"[Gmail]/Trash\"\n    halt-on-match: true\n\n  - name: \"Label GitHub\"\n    condition: |\n      \"notifications@github.com\" in message.from\n    action: label \"0-GitHub\"\n  - name: \"Label GitHub mentions\"\n    condition: |\n      \"notifications@github.com\" in message.from and \"mention@noreply.github.com\" in message.cc\n    action: label \"Mentioned\"\n  - name: \"Label GitHub review requests\"\n    condition: |\n      \"notifications@github.com\" in message.from and \"review_requested@noreply.github.com\" in message.cc\n    action: label \"1-Review Requested\"\n  - name: \"Label GitHub comments\"\n    condition: |\n      \"notifications@github.com\" in message.from and \"author@noreply.github.com\" in message.cc\n    action: label \"Comment\"\n  - name: \"Label GitHub merged PRs\"\n    condition: |\n      \"notifications@github.com\" in message.from and message.body contains \"Merged #\" and message.body contains \" into main.\"\n    action: label \"2-Merged\"\n  - name: \"Label GitHub approvals\"\n    condition: |\n      \"notifications@github.com\" in message.from and message.body contains \"approved this pull request.\"\n    action: label \"Approved\"\n\n  - name: \"Label Sentry notifications\"\n    condition: |\n      \"noreply@md.getsentry.com\" in message.from\n    action: label \"Sentry\"\n  - name: \"Label Opsgenie notifications\"\n    condition: |\n      \"opsgenie@opsgenie.net\" in message.from\n    action: label \"Opsgenie\"\n  - name: \"Label Google Docs notifications\"\n    condition: |\n      (\"comments-noreply@docs.google.com\" in message.from or \"drive-shares-dm-noreply@google.com\" in message.from) and count(message.fromName, # contains \"Google Docs)\") \u003e 0\n    action: label \"Google Docs\"\n```\n\n#### Condition expression\n\nPlease refer to [`expr-lang/expr`](https://expr-lang.org/) for the syntax manual, available variables are as follows:\n\n| Name      | Type      | Description       |\n|-----------|-----------|-------------------|\n| `message` | `Message` | The email message |\n\nType `Message`:\n\n| Name       | Type       | Description                                                                                |\n|------------|------------|--------------------------------------------------------------------------------------------|\n| `from`     | `[]string` | The list of `from` addresses, e.g. `[\"notifications@github.com\"]`                          |\n| `fromName` | `[]string` | The list of `from` names, e.g. `[\"Joe Chen\"]`                                              |\n| `subject`  | `string`   | The email subject                                                                          |\n| `cc`       | `[]string` | The list of `cc` addresses, e.g. `[\"joe@acme.com\", \"review_requested@noreply.github.com\"]` |\n| `to`       | `[]string` | The list of `to` addresses, e.g. `[\"acme@noreply.github.com\"]`                             |\n| `body`     | `string`   | The email body                                                                             |\n\nIf `halt-on-match` is `true`, then it will be the last action to take upon matching.\n\n#### Actions\n\n\u003e[!note]\n\u003e Gmail mailboxes and labels must already exist in your Gmail settings.\n\u003e You can use `gmail-blade list-mailboxes` to get all your mailboxes and labels.\n\n| Action        | Description                                                        |\n|---------------|--------------------------------------------------------------------|\n| `move to \"X\"` | Move the message to the \"X\" mailbox, e.g. `move to \"[Gmail]/Spam\"` |\n| `label \"X\"`   | Add label \"X\" to the message, e.g. `label \"GitHub\"`                |\n| `delete`      | Delete the message, shortcut for `move to \"[Gmail]/Trash\"`         |\n\nActions are executed in the same order as they are defined. You will get marginal performance benefit if you put `halt-on-match` ones on the top.\n\n### Execution\n\nThe sidecar _only_ looks at unread emails.\n\nTo run the sidecar once, do `gmail-blade once`. To test your filters, you can dry run with `gmail-blade once --dry-run --debug`.\n\nTo run the sidecar as a long-running service, do `gmail-blade server`, it pauses 30s after each run. It also supports `--dry-run` and `--debug` if you want to.\n\nUse `--help` flag to get helper information on `gmail-blade` and its subcommands.\n\n## License\n\nThis project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funknwon%2Fgmail-blade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funknwon%2Fgmail-blade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funknwon%2Fgmail-blade/lists"}