• Stars
    star
    552
  • Rank 80,595 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tool to sync Gmail filters from a config file to your account.

gmailfilters

make-all make-image GoDoc Github All Releases

A tool to sync Gmail filters from a config file to your account.

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

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:[email protected]"
archive = true
read = true

[[filter]]
query = "from:[email protected] LGTM"
label = "github/LGTM"

[[filter]]
query = """
(-to:[email protected] \
(from:([email protected]) AND (@jfrazelle OR @jessfraz OR to:[email protected] OR to:[email protected] OR to:[email protected])))
"""
label = "github/mentions"

[[filter]]
query = """
to:[email protected] \
-to:[email protected] \
-to:[email protected] \
-to:[email protected]
"""
label = "github/team-mention"

[[filter]]
query = """
from:[email protected] \
-to:[email protected] \
-to:[email protected] \
-to:[email protected] \
-to:[email protected]
"""
archive = true

[[filter]]
query = "(from:me AND to:[email protected])"
label = "github/mentions"

[[filter]]
query = "(from:[email protected])"
label = "github"

[[filter]]
queryOr = [
"to:[email protected]",
"to:[email protected]",
"to:[email protected]",
"to:[email protected]"
]
delete = true

[[filter]]
queryOr = [
"from:[email protected]",
"from:[email protected]",
"from:[email protected]"
]
label = "to-be-deleted"

[[filter]]
query = "[email protected] 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:[email protected]"
label = "Mailing Lists/coreos-dev"
archiveUnlessToMe = true

[[filter]]
queryOr = [
"list:[email protected]",
"list:[email protected]"
]
label = "Mailing Lists/xdg-apps"
archiveUnlessToMe = true

Setup

Gmail

  1. 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.

More Repositories

1

dockerfiles

Various Dockerfiles I use on the desktop and on servers.
Dockerfile
13,270
star
2

dotfiles

My dotfiles. Buyer beware ;)
Shell
3,166
star
3

.vim

My .vim dotfiles and configurations.
Vim Script
618
star
4

branch-cleanup-action

A GitHub action to automatically delete the branch after a pull request has been merged.
Shell
427
star
5

dockfmt

Dockerfile format and parser. Like `gofmt` but for Dockerfiles.
Go
425
star
6

k8s-snowflake

Configs and scripts for bootstrapping an opinionated Kubernetes cluster anywhere.
Shell
397
star
7

tdash

A terminal dashboard with stats from Google Analytics, GitHub, Travis CI, and Jenkins. Very much built specific to me.
Go
307
star
8

netscan

Scan network ips and ports.
Go
255
star
9

s3server

Server to index & view files in a s3 or Google Cloud Storage bucket.
Go
235
star
10

morningpaper2remarkable

A bot to sync the morning paper to a remarkable tablet.
Go
219
star
11

gitable

Bot to automatically sync and update an airtable sheet with GitHub pull request and issue data.
Go
201
star
12

advent-of-cuda

Doing advent of code with CUDA and rust.
Rust
200
star
13

onion

Tor networking plugin for Docker containers. Route all container tcp traffic through Tor.
Go
198
star
14

hashtag-pull

Get all twitter, vine, and instagram posts with a certain hashtag, print the feed, and save to a database for future use. (old & depreciated)
PHP
180
star
15

gadgets

A repo to keep track of interesting gadgets and toys that I find or someone tells me about.
158
star
16

pony

Local file-based password, API key, secret, recovery code store backed by GPG.
Go
149
star
17

cliaoke

Command Line Karaoke.
Go
147
star
18

jenkins-dsl

Jenkins DSLs for my Jenkins instance, keeps forks up to date, mirrors repositories to private git, builds all Dockerfiles and more.
Groovy
132
star
19

containers

OCI compatible & runc configs for various containers.
Shell
129
star
20

aws-fargate-action

A GitHub action to deploy to AWS Fargate on push to the master branch.
HCL
121
star
21

blog

Source for my blog.
CSS
114
star
22

tupperwarewithspears

Distributed load testing with containers, Apache benchmark, with OpenVSwitch for networking.
Go
108
star
23

openai.vim

OpenAI GPT-3 plugin for vim.
Vim Script
96
star
24

shaking-finger-action

A GitHub action that displays a gif of Conan O'Brien shaking his finger to a pull request on fail.
Shell
95
star
25

cni-benchmarks

A simple program to benchmark various container networking (CNI) plugins.
Go
84
star
26

lkml.wtf

Source code for lkml.wtf.
HTML
78
star
27

jessfraz

74
star
28

pastebinit

Go implementation of pastebinit.
Go
73
star
29

tor

Development fork of https://git.torproject.org/tor.git
C
67
star
30

random-forest-classifier

A random forest classifier in Javascript.
JavaScript
58
star
31

irssi

Official Docker image for irssi.
Shell
50
star
32

strace2elastic

Strace container output to a file, then shove the syscalls into elastic search.
Python
49
star
33

printinator

A MacOS menubar for 3D printers.
Swift
47
star
34

macgyver

The Macgyver of Dlopening: `dlopen` yourself!
Go
45
star
35

ship

Command line tool to track packages using the AfterShip API.
Go
45
star
36

what-can-i-say-im-a-hopeless-open-source-romantic

Repo for designing shirts!
42
star
37

directory-theme

A customizable theme for your Apache or Nginx directory. (old & depreciated)
HTML
39
star
38

terraform-cluster

Scripts to create a minimal mesos or nomad cluster using terraform.
HCL
39
star
39

ykpiv

Go bindings for ykpiv so you can write Go to interact with your yubikeys.
Go
35
star
40

libyubikey

Go bindings for libyubikey so you can write Go to interact with your yubikeys.
Go
35
star
41

dstats

Docker stats dashboard for your terminal. (WIP that was never finished)
JavaScript
34
star
42

tripitcalb0t

Bot to automatically create Google Calendar events from TripIt flight data.
Go
29
star
43

battery

Linux battery status checker.
Makefile
28
star
44

apparmor-docs

Auto generated pdfs of apparmor .odt files direct from launchpad branch.
Makefile
28
star
45

junk

A place for everything without a home.
Go
27
star
46

party-clippy

Go server that shows clippy. Nice for curl in demos.
Go
23
star
47

systemd-butts

Chrome extension to replace systemd with butts on websites.
JavaScript
20
star
48

github-rate-limit

A little web app deployed to Vercel to return a more human-readable JSON output from the GitHub rate limit endpoint.
Go
17
star
49

goodreads-dewey

A tool to get the dewey decimal number for books in your Goodreads account.
Go
16
star
50

docker-presentation

Instructions on building a server with Docker and Nginx on Ubuntu trusty 14.04. (old & depreciated)
Shell
16
star
51

weirdtrickmafia.fm

Site for the podcast.
HTML
15
star
52

linux

Fork of Linux kernel for development (includes linux-security & linux-next).
C
13
star
53

jessfraz-overlay

Portage overlay with custom Gentoo ebuilds.
Shell
12
star
54

secping

A tool for reading the SECURITY_CONTACTS file in a kubernetes repository.
Go
11
star
55

usbc-pal

10
star
56

go-benchmarks

Run go test benchmarks for versions over time.
Dockerfile
6
star
57

snippetlib

Site for hosing code snippets. (old & deprecated)
Less
5
star
58

generator-xbars

Yeoman generator for node with express, handlebars, & bootstrap. (old & depreciated)
JavaScript
3
star
59

present.j3ss.co

Go talk slides made with https://golang.org/x/tools/cmd/present.
Shell
3
star
60

notorious-svg

Barrel Creative Days Project.
CSS
2
star