Coder Social home page Coder Social logo

gic's Introduction

Gmail Inbox Control

Take control of your Gmail Inbox!

  • Are you tired of strangers, irrelevant and cold emails coming straight into your Inbox?
  • Are you annoyed by unknown senders being mixed into your important and urgent emails in your Inbox?

With the Gmail Inbox Control only email senders that you have allowed will end up straight in your Inbox. All other emails will end up in a Screening label in Gmail, for a later time. From there you can easily Allow or Disallow new people from sending you emails.

It's implemented as a Google Web App, on top of Gmail & Google Spreadsheet. Inspired by Hey’s Imbox, and technically from gmailFilter.

How do I use it?

  1. All new emails will be moved from your Inbox into the "--Screen" label.
  2. In the "--Screen" label view, you can choose to Allow or Disallow the sender of that email to arrive in your inbox next time.
  3. After this step, allowed email senders will stay in your Inbox, Disallowed or New email senders will not appear in your Inbox.

image

Allow a sender

  1. Go to "--Screen" label
  2. Select one or multiple emails
  3. Add the label "--Allow" to the selected emails
  4. From now on, the senders will end up in your Inbox directly, and not go to screening.

Allow

Disallow a sender

  1. Go to "--Screen" label
  2. Select one or multiple emails
  3. Add the label "--Disallow" to the selected emails
  4. From now on, the senders will not end up in your Inbox or Screen, but be archived directly once received.

Technically: How does it work ?

  • Allow & Disallow
    • (Every 10 mins): When you label an email with "--Allow" label, a Trigger script runs periodically and adds the email address to a list of Allowed senders (a tab in the Spreadsheet database).
    • (Every 10 mins) The emails you labelled with "--Disallow" follows the same pattern, but is instead added to Disallowed senders (a tab in the Spreadsheets database).
  • Filtering emails in your Inbox
    • (Every 10 mins) The spreadsheet database of allowed and disallowed senders, is used to scan your Inbox and
        1. Keep emails from allowed senders (mark thenm with label --Allow), and
        1. Move Disallowed emails out of the inbox, and move any new (unknown) senders to --Screen label.

Notes:

  • You can also manually add / change / remove allowed senders directly in the Spreadsheet database (see below)
  • You can change the timing of the triggers in https://script.google.com/home/triggers
  • This script does never delete any emails, it just move emails from your inbox and uses labels to filter allowed, disallowed and unknown senders. The script runs only within your google account, there are no servers etc. No data or information is shared outside your own account. The source code is provided on this page. However due to lack of granularity in the Gmail & App authorization scopes, the script does not work with less priviledges than the ones asked for.

Starting tips - The Database

To get started, it can be good to add your organisations email domain (and close collaborator organisations domains) to Allowed senders directly, to save some time in screening emails. You can do that by adding a row in the Allowed senders sheet of the Database spreadsheet, with the content "@yourdomain.com" (see image below). Then all email senders from that domain will be allowed, and come directly to your inbox. It works the same for the Disallowed senders tab.

The list is stored in the Database Spreadsheet, which is created once you load the Setup page, and is found here:

How do I install it?

Option 1: Install manually

  • Create a Google App script on your own in your organisation (https://script.google.com/home)
  • Create a new project, and paste the code from this repo (Code.js and index.html).
  • Then run the app, by creating a deployment of it (Deployments doc)
  • Lastly: Go to the web app url (visible in the Deployment option in Google Scripts) - that will initialise all functionality.

Option 2: Install by URL

Troubleshooting

Installation checks

Have a look at the setup page of the web app, as it automatically tries to create all labels, triggers and the database spreadsheet when it loads (if they do not already exist), and also shows the status of them. Screenshot 2023-07-22 at 10 06 28

Try manually

You can run the triggers manually if you have troubles, just go to the Setup page of this web app where there are test buttons or find the Triggers yourself (https://script.google.com/home/triggers).

Nothing happens / Unallowed emails stays in the inbox

Note that the triggers are scheduled every 10 mins as a default, this means that for up to 10 mins emails can be in your inbox until they are moved. You can change the periodicity of the triggers if you want this to run more often.

You can also look at the logs of the 3 Triggers (https://script.google.com/home/triggers), to see if there are any errors there. Screenshot 2023-07-22 at 10 09 53

Error emails

Sometimes the scripts might fail, for different reasons (API's doesn't respond, trouble with the connection etc). Since the scripts run periodically and very frequent, this is not a big issue if it happens once or twice. You can see all errors in the logs and also change the error emails recevied by the application in Triggers: Screenshot 2023-07-22 at 10 11 39

Knows issues

There are some known issues:

  • Multiple entries with same address: When adding --Allow to multiple screening emails at the same time, it causes multiple entries in the Spreadsheet database. This is not a functional issue per see, but looks confusing.

Uninstall

To uninstall the app, go to your Connections (https://myaccount.google.com/connections), find "GIC - Google Inbox Control", and remove it and all access for it.

Feedback, thoughts & improvements

Feel free to submit a PR or send me an email if you have any questions, feedback or thoughts of improvement.

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.