Gmailfilters
A tool to sync Gmail filters from a config file to your account.
Install / Use
/learn @jessfraz/GmailfiltersREADME
gmailfilters
A tool to sync Gmail filters from a config file to your account.
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->NOTE: This makes it so the single configuration file is the only way to add filters to your account, meaning if you add a filter via the UI and do not also add it in your config file, the next time you run this tool on your outdated config, the filter you added only in the UI will be deleted.
Table of Contents
<!-- END doctoc generated TOC please keep comment here to allow auto update -->Installation
Binaries
For installation instructions from binaries please visit the Releases Page.
Via Go
$ go get github.com/jessfraz/gmailfilters
Usage
$ gmailfilters -h
gmailfilters - A tool to sync Gmail filters from a config file to your account.
Usage: gmailfilters <command>
Flags:
-d, --debug enable debug logging (default: false)
-e, --export export existing filters (default: false)
-f, --creds-file Gmail credential file (or env var GMAIL_CREDENTIAL_FILE) (default: <none>)
-t, --token-file Gmail oauth token file (default: /tmp/token.json)
Commands:
version Show the version information.
Example Filter File
[[filter]]
query = "to:your_activity@noreply.github.com"
archive = true
read = true
[[filter]]
query = "from:notifications@github.com LGTM"
label = "github/LGTM"
[[filter]]
query = """
(-to:team_mention@noreply.github.com \
(from:(notifications@github.com) AND (@jfrazelle OR @jessfraz OR to:mention@noreply.github.com OR to:author@noreply.github.com OR to:assign@noreply.github.com)))
"""
label = "github/mentions"
[[filter]]
query = """
to:team_mention@noreply.github.com \
-to:mention@noreply.github.com \
-to:author@noreply.github.com \
-to:assign@noreply.github.com
"""
label = "github/team-mention"
[[filter]]
query = """
from:notifications@github.com \
-to:team_mention@noreply.github.com \
-to:mention@noreply.github.com \
-to:author@noreply.github.com \
-to:assign@noreply.github.com
"""
archive = true
[[filter]]
query = "(from:me AND to:reply@reply.github.com)"
label = "github/mentions"
[[filter]]
query = "(from:notifications@github.com)"
label = "github"
[[filter]]
queryOr = [
"to:plans@tripit.com",
"to:receipts@concur.com",
"to:plans@concur.com",
"to:receipts@expensify.com"
]
delete = true
[[filter]]
queryOr = [
"from:notifications@docker.com",
"from:noreply@github.com",
"from:builds@travis-ci.org"
]
label = "to-be-deleted"
[[filter]]
query = "drive-shares-noreply@google.com OR (subject:\"Invitation to comment\" AND from:me ) OR from:(*@docs.google.com)"
label = "to-be-deleted"
[[filter]]
query = "(from:(-me) {filename:vcs filename:ics} has:attachment) OR (subject:(\"invitation\" OR \"accepted\" OR \"tentatively accepted\" OR \"rejected\" OR \"updated\" OR \"canceled event\" OR \"declined\") when where calendar who organizer)"
label = "to-be-deleted"
[[filter]]
query = "list:coreos-dev@googlegroups.com"
label = "Mailing Lists/coreos-dev"
archiveUnlessToMe = true
[[filter]]
queryOr = [
"list:xdg-app@lists.freedesktop.org",
"list:flatpak@lists.freedesktop.org"
]
label = "Mailing Lists/xdg-apps"
archiveUnlessToMe = true
Setup
Gmail
-
Enable the API: To get started using Gmail API, you need to first create a project in the Google API Console, enable the API, and create credentials.
Follow the instructions for step enabling the API here.
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
