Giter Site home page Giter Site logo

dafyddcrosby / gmailfilters Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jessfraz/gmailfilters

0.0 2.0 0.0 1.3 MB

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

License: MIT License

Dockerfile 2.82% Makefile 27.97% Go 69.21%

gmailfilters's Introduction

gmailfilters

Travis CI 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.

gmailfilters's People

Contributors

jessfraz avatar jnsn avatar toc-me[bot] avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.