From d4b4e19223f0b045b773d8d60a508374230da0fc Mon Sep 17 00:00:00 2001 From: Moritz Graf Date: Sat, 25 Apr 2026 14:00:10 +0200 Subject: [PATCH] Now activated --- mail_forwarding/AGENTS.md | 4 ++++ mail_forwarding/README.md | 11 +++++------ mail_forwarding/src/Code.js | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mail_forwarding/AGENTS.md b/mail_forwarding/AGENTS.md index becd234..29260b3 100644 --- a/mail_forwarding/AGENTS.md +++ b/mail_forwarding/AGENTS.md @@ -11,6 +11,10 @@ It automates the creation of email forwarding in Google Workspace by reading fro - The entrypoint is `src/Code.js`. - The manifest is `src/appsscript.json`. +## Status +- **Current Mode:** Active Production (`DRY_RUN: false`). +- **Target:** All groups managed by this script are tagged with `[Auto-Forwarder] Managed by Google Sheets`. + ## Rules & Safeguards (CRITICAL) 1. **Never alter the `GROUP_DESCRIPTION_TAG` logic.** The script achieves declarative state management by finding and deleting Workspace Groups that are NOT present in the Google Sheet. To prevent the catastrophic deletion of real, human-managed groups (e.g., `board@haumdaucher.de`), the script relies on the `[Auto-Forwarder] Managed by Google Sheets` string in the group's description. The script must ALWAYS filter for this exact string before issuing any deletion API calls. diff --git a/mail_forwarding/README.md b/mail_forwarding/README.md index 2d62c0d..702cd4a 100644 --- a/mail_forwarding/README.md +++ b/mail_forwarding/README.md @@ -75,13 +75,12 @@ The code is now in the cloud, but the background triggers need to be activated a - Click "Allow" to grant access to the Admin Directory API, Gmail API, and Google Sheets. 5. Once authorized, the `setup` function will finish executing. It installs the background `onChange` trigger. -## Step 5: Going Live -By default, the `CONFIG` block has `DRY_RUN: true`. This means the script will parse the sheet, output exactly what it *intends* to do to the logs, and email you a report, but it will **not** actually create, modify, or delete any Google Workspace Groups. +## System Status: LIVE +The system is currently configured for active production (`DRY_RUN: false`). Any changes to the Google Sheet will result in real-time creation, modification, or deletion of Google Workspace Groups. -Once you have reviewed the dry-run execution logs and verified that the script correctly parses all rows and maps the email addresses as you expect: -1. Open `src/Code.js` and change `DRY_RUN: true` to `DRY_RUN: false`. -2. Run `clasp push` in your terminal to deploy the update. -3. Edit the spreadsheet one more time to trigger the live sync. +To revert to dry-run mode for testing: +1. Open `src/Code.js` and change `DRY_RUN: false` to `DRY_RUN: true`. +2. Run `clasp push`. **You are done!** Whenever a new response is submitted to the configured Google Sheet via Forms, the script will automatically run in the background, reconcile the forwarding groups, and send you an email report. diff --git a/mail_forwarding/src/Code.js b/mail_forwarding/src/Code.js index ff4cf7c..9d6cdd6 100644 --- a/mail_forwarding/src/Code.js +++ b/mail_forwarding/src/Code.js @@ -25,7 +25,7 @@ const CONFIG = { // Dry run mode. If true, the script will only log what it would do and send the email, // but will NOT actually create, update, or delete any groups in Workspace. - DRY_RUN: true, + DRY_RUN: false, // DO NOT CHANGE THIS VALUE. // This tag is added to the description of groups created by this script.