Please help me install and set up "Garnet" from veered.org on my own computer or server. What it is: Daily email of real mail that Gmail put in spam. It runs on: Your own Google account (Google Apps Script): nothing to install. Project page: https://veered.org/gmail-spam-check/ Source code download (zip): https://veered.org/gmail-spam-check/garnet-gmail-spam-check.zip How I'd like you to help: 1. First ask me what you need to know: my operating system and version, my desktop environment if it matters, whether I'm comfortable with the terminal, and any accounts or hardware this project needs. 2. Then take me through it one step at a time. For each command, say briefly what it does, and wait for me to paste back the result before moving on. 3. Before any step that changes system settings, uses sudo, or edits an existing configuration file, tell me, and have me make a backup first. 4. If something fails, help me work out why. If the instructions below don't fit my system, say so rather than guessing. 5. At the end, show me how to check that it works, and how to uninstall it. The project is shared as-is by its author, with no warranty. If we find a problem in the project itself, please help me write a short, clear note I can send to support@veered.org. Here is the project's documentation (README files from the download): ===== README.md ===== # Gmail Spam Check (Garnet): a daily report of real mail stuck in spam *Why Garnet? Travelers once carried a garnet to keep them safe on the road; this one keeps watch over the mail that strays.* **Runs on** your own Google account, as a Google Apps Script: no server, no app passwords, nothing to install. **Version 1.0.** Part of [Veered](https://veered.org): free tools, shared as-is. Questions: support@veered.org Gmail's spam filter sometimes catches a client, a customer or a government notice. Garnet looks through your spam folder once a day and emails you a short report of the messages that probably don't belong there, each with a short preview and two buttons: **Not spam** moves it to your inbox, **Really spam** keeps that sender out of future reports. ![A sample report: a client's email, a USPTO notice and a new trademark inquiry, each with Not spam and Really spam buttons](docs/screenshot.png) ## What it flags - **Senders you have written to**: anyone at an address you've sent mail to, or at a company domain you've written to (when the message passes SPF or DKIM, so it isn't forged). - **Verified government and payment mail**: any `.gov` or `.court` domain, plus the senders in `trusted` (PayPal, DocuSign and so on). - **Possible new business**: verified senders whose subject has one of your `inquiry` words (quote, invoice, appointment…). It skips newsletters (anything with an unsubscribe header), sales pitches matching the `pitch` words, your own domains (forged mail "from" you can pass SPF) and the addresses in `ignore`. Your button clicks are remembered by sender: the latest click wins, and two "Really spam" clicks at the same company domain hide the whole domain. Spam is written by strangers, so the report shows only plain text, with every link removed. ## Set it up (about 5 minutes) 1. Go to [script.google.com](https://script.google.com), signed in to the Gmail account you want checked, and click **New project**. Name it "Spam check". 2. Delete the sample code, paste in all of [`Code.gs`](Code.gs), and click **Save**. 3. Edit `SETTINGS` at the top: your own domains, the hour you want the report, and your `inquiry` words (see the example below). 4. In **Project Settings** (the gear), set the time zone, and tick **Show "appsscript.json"**. Replace that file's contents with [`appsscript.json`](appsscript.json). 5. Pick **setup** in the function menu and click **Run**. Google asks you to allow access to your Gmail: click your account, then **Advanced → Go to Spam check (unsafe)** → **Allow**. ("Unsafe" only means the script isn't one Google has reviewed: it's yours, running in your own account.) Your first report, covering the last 7 days, arrives a minute later. 6. For the buttons: **Deploy → New deployment**, type **Web app**, *Execute as* **Me**, *Who has access* **Only myself**, then **Deploy**. Reports made after this show the buttons. To try settings without sending anything, pick **dryRun** and click **Run**: the report appears in the execution log. ## Example settings for a law office ``` ownDomains: ['yourfirm.com'], trusted: ['uspto.gov', 'wipo.int', 'epo.org', 'paypal.com', 'docusign.net'], inquiry: /\b(patents?|trademarks?|copyrights?|invention|inventor|office action|infring\w*|cease and desist|attorney|lawyer|consultation|retainer|invoice)\b/i, pitch: /\b(services?|support|expert|outsourc\w*|analytics|resume|job|newsletter|webinar|expand your reach)\b/i, ``` ## Notes - Gmail deletes spam after 30 days, and the buttons stop working after 30 days too. - If you are signed in to several Google accounts, a button may say it can't open the page. Open it in a window signed in only to this account, or sign in to this account first. - To stop it: **Triggers** (the clock icon) → delete the `dailyCheck` trigger. - Google limits a free Gmail account to about 20,000 reads a day, far more than this needs.
For the curious - `Code.gs` is the whole program. It keeps two values in your script's private storage: the time of the last run, and your button verdicts. - If a run fails, it emails you "Gmail spam check FAILED" and the next run covers the missed mail. - `tests/run.js` checks the logic against fake mail: `node tests/run.js` (Node only, no packages).
## License MIT License. ----- For Claude Code users ----- Download https://veered.org/gmail-spam-check/garnet-gmail-spam-check.zip, unzip it into a new folder, read every README.md in it, and help me install and set up "Garnet" (Daily email of real mail that Gmail put in spam) on this machine. Check the requirements against this system first and tell me what is missing. Ask me before running anything with sudo, installing packages, or changing existing configuration files, and back those files up first. Finish by showing me how to test it and how to uninstall it.