Want the instructions in Google Docs instead? Click here.
The purpose of OutboundBlock is identify and block unwanted B2B spam. It uses a Nyckel-created text classification model.
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 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.
-
Go to App Scripts.
-
Turn off any adblockers and enable pop ups for the page.
-
Create a new project. You can go to Editor on the left nav bar.
- Click on the plus sign and add a script.
-
Remove the current code that's there.
-
Copy and paste the code found in outboundblock.gs. Give it a name like "OutboundBlock"
-
Save it.
-
Click on the down arrow next to Execution Log.
-
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.
- Next, you'll want to select "Outboundblock2" from the same list, press run, then give it authorization.
-
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.
-
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.
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:
- 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.
- Nyckel does not store API requests. No one at Nyckel can see your emails.
- 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.
- It looks at unread emails that have come in in the past hour.
- It ignores emails that include certain hardcode phrases or domains, including any emails from people who work at your company.
- It cleans up and sends the subject/body to Nyckel for classification.
- 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.
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'];
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.
Deleting the trigger will stop OutboundBlock from running. You can also remove the code itself from the Editor view.