Giter VIP home page Giter VIP logo

outboundblock's Introduction

Want the instructions in Google Docs instead? Click here.

OutboundBlock (Powered by Nyckel)

The purpose of OutboundBlock is identify and block unwanted B2B spam. It uses a Nyckel-created text classification model.

outboundblock

The current beta version is a Google App Script, a scripting tool that interacts with your Google Workspace apps. It's just copy/pasting, so you don't need technical experience to get going.

The code is in outboundblock.gs.

If updating to a newer version

If you are moving from an older version of OutboundBlock to a new one, please delete your current trigger and the current project. Then, re-follow the instructions below.

Setting it up

  1. Go to App Scripts.

  2. Turn off any adblockers and enable pop ups for the page.

  3. Create a new project. You can go to Editor on the left nav bar.

Screenshot 2024-03-19 at 11 40 01 AM
  1. Click on the plus sign and add a script.
Screenshot 2024-03-19 at 11 40 43 AM
  1. Remove the current code that's there.

  2. Copy and paste the code found in outboundblock.gs. Give it a name like "OutboundBlock"

  3. Save it.

  4. Click on the down arrow next to Execution Log.

  5. Select "GetUserDomain". Then press Run. If it gives you a "couldn't find myfunction" error, run it again. It will prompt you for authorization. After that, press Run again.

Screenshot 2024-04-24 at 8 59 13 PM
  1. Next, you'll want to select "Outboundblock2" from the same list, press run, then give it authorization.
Screenshot 2024-04-23 at 2 14 12 PM
  1. If it doesn't automatically initiate the script, press Run again. It will run the script for the first time. Depending on your # of unread emails, this could take anywhere from 15s to 5 mins.

  2. Now go to Triggers on the left nav bar, create a new trigger, and set up a time-based trigger for the outboundblock2 function. We recommend using the “minute” time period and setting it for every 15 minutes. The script will run 15 minutes after you turn the trigger on. Please note: do not set it for more often than every 15 minutes, as the script will hit run limits and start failing.

Screenshot 2024-03-19 at 11 44 27 AM

Security / authentication notes

We understand if the permission warning is daunting, but that is the warning it gives for any third-party App Script, as none of them have gone through the Google Extension approval process.

We recommend reviewing the code yourself to understand what exactly is does. As you'll see, the code looks at Gmail emails and sends them to Nyckel for classification. There is no logic for writing, sending, or deleting emails, nor any logic for interacting with Google Sheets, Docs, etc.

Some additional security notes:

  1. Once you add the code, Nyckel has no access to it. There's no way for Nyckel to inject additional logic into your app script.
  2. Nyckel does not store API requests. No one at Nyckel can see your emails.
  3. The script, by default, ignores emails from people with the same domain as you. Meaning, your internal company emails will never be sent to Nyckel, providing an additional security layer.

How OutboundBlock works

  1. It looks at unread emails that have come in in the past hour.
  2. It ignores emails that include certain hardcode phrases or domains, including any emails from people who work at your company.
  3. It cleans up and sends the subject/body to Nyckel for classification.
  4. If the model determines the email is spam, it will archive it from the inbox and move it to the B2BSpam label. It will remain unread. If that label don't exist, it will create them.

How to ensure certain domains never get moved to spam

At the script's top is a constant for defining any domains that will be ignored by the script (and not sent to Nyckel). Feel free to add to this (or remove).

const IGNORED_DOMAINS = ['google', 'github', 'microsoft', 'substack'];

Very first run

In the very first run, the script looks at any unread emails in the inbox (up to 100) from the past 30 days. After that it only looks at unread emails received in the past hour.

Removing OutboundBlock

Deleting the trigger will stop OutboundBlock from running. You can also remove the code itself from the Editor view.

outboundblock's People

Contributors

cshuptrine avatar

Watchers

Oscar Beijbom avatar Dan Ott avatar George Mathew 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.