Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/svenfuchs/gmail_filters


https://github.com/svenfuchs/gmail_filters

Last synced: 12 days ago
JSON representation

Awesome Lists containing this project

README

        

# Gmail Filters

*The things we do because Gmail rules do not allow to delete a label*

Experimental, not much to see.

## Usage

Define filters in Ruby files, e.g.:

```ruby
# ~/.gmail_filters/trash.rb

filter do
has 'in:spam'
archive
mark_read
end

filter do
from '[email protected]', '[email protected]'
archive
mark_read
delete
end
```

To exclude conditions from previous filters:

```ruby
# ~/.gmail_filters/github.rb

filter do
list 'foo.my-org.github.com'
# ...
end

filter do
list 'bar.my-org.github.com'
# ...
end

# exports "list:*[email protected] AND -(list:[email protected] OR list:bar.my-org.github.com)
otherwise do
list '*.my-org.github.com'
# ...
end
```

Optionally configure author and email:

```yaml
# ~/.gmail_filters/config.yml

author: Sven Fuchs
email: [email protected]
```

Export to XML:

```
$ bin/gmail-filters export
```

## Credits

**Heavily** inspired by [@antifuchs](https://github.com/antifuchs)' very nice [gmail-britta](https://github.com/antifuchs/gmail-britta).