Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/sergiopvilar/gmail-filter-manager

A tool written in javascript to help you manage your gmail filters out of gmail
https://github.com/sergiopvilar/gmail-filter-manager

Last synced: about 1 month ago
JSON representation

A tool written in javascript to help you manage your gmail filters out of gmail

Awesome Lists containing this project

README

        

# Gmail Filter Manager

A tool written in javascript to help you manage your gmail filters out of gmail

## Features

- Support to your current filters through Gmail exported .xml
- Delete filter: deletes all emails from an email list
- Review filter: ignores from the inbox and adds a label so you can review before delete

## Setup

You'll need node.js and yarn to run this tool.

Install the dependencies:
```
yarn install
```

Create an `.env` file at the root level with the following information:

```
ARCHIVE_LABEL='Review before delete'
PRIORITY_MAIL='[email protected]'
```

- `ARCHIVE_LABEL` is the label applied to the Review filter
- `PRIORITY_MAIL` is the email addresses you can use to ignore the filters generated by this tool

## Feeding with your data

### Current Filters

You can start managing your filters by exporting them in Gmail and adding the .xmls into `/input` directory.
All .xml files there will be imported and parsed.

### Email Lists

You can manage new filters by using email lists in the `/lists` directory:

- `delete.txt`: list of emails that will be deleted
- `archive.txt`: lisf of emails that will be ignored from the inbox and have the custom label applied

The lists are expected to have one valid email per line.

### Updating Mail Lists

It will be hard to keep your filters updated once you have imported everything, so in order to do that you can use
these two files to add new email addresses to a separated filter file where you can import in gmail only the new ones
and not the whole list. The new emails will be added to the respective `delete.txt` and `archive.txt` files once the
.xml file is generated.

- `delete_update.txt`: lisf of new emails that will be deleted
- `delete_update.txt`: lisf of new emails that will be ignored from the inbox and have the custom label applied

## Running

To convert your mail lists into filter files you'll need to run:

```yarn start```

This will:

- Clear the previous output files
- Import your .xml filters
- Generate new .xml filters based on your lists

## Importing into Gmail

This tool split the filters in many files this way you won't need to worry about Gmail stucking during the import.
These files will be generated under the `/output` directory:

- `archive_n.xml`: All emails that will be ignored from inbox and have the custom label applied (many files)
- `delete_n.xml`: All emails that will be deleted (many files)
- `filter_n.xml`: All your .xml filters you added to the `/input` directory (many files)
- `delete_update.xml`: New filters added to the delete list
- `archive_update.xml`: New filters added to the archive list

Notice that the _delete.xml files could be imported separately so you won't need to import everything when adding new
emails to a list.