Real-Time Gmail Watch via Grok Mailbox Relay
Create a Grok-exclusive mailbox → route Gmail by sender or use a cloud script fallback → incoming mail triggers instant assistant alert
- Who
- Users with multiple Gmail accounts who need real-time alerts for replies from specific contacts
- You get
- When a watched contact replies, the Grok assistant is triggered immediately to draft a response; human approval is required before any email is sent
- You need
- Gmail
Constraints
Requires a Grok Bot account, at least one Gmail account, and Google Cloud project permissions; optional Grok cloud computer for the script fallback route. Cost: Grok quota is consumed only once per actual incoming mail that triggers the assistant; Gmail forwarding and cloud script execution incur no quota.
What they did
Author william40152988 manages multiple Gmail accounts with a Grok assistant team. Previously the assistant polled all mailboxes every 5 minutes, wasting quota, lagging, and unable to watch specific contacts. The author switched to a Grok-exclusive mailbox ([email protected]) as a relay, using its "incoming mail triggers" feature. For Gmail accounts that allow forwarding, sender-based filters forward mail to the Grok mailbox. For accounts that don't, a scheduled script on the Grok cloud computer serves as fallback. Daily contact watch/unwatch is done via conversational commands.
How it went
The author reports that forwarding and script execution consume no Grok quota; only actual incoming mail that triggers the assistant costs quota once. Replies arrive near-instantly at the Grok mailbox, the assistant wakes immediately to report and draft a response, and all outgoing emails require human approval before sending. (author_report)
Worth knowing
Each user gets only one Grok mailbox; it is permanent after creation and cannot be renamed. Some Gmail accounts do not display the "add forwarding address" button with no stated reason; use the script fallback directly. The OAuth consent screen must be published to production or test authorization expires in 7 days. Auth tokens should be stored only on the Grok cloud computer locally, never in version control. After a cloud computer restart, verify scheduled tasks are still active. The script source code is not provided in the original text and must be written by the user with Cursor or the assistant. This site has not tested this workflow.
Steps
Create a Grok mailbox and set up the incoming-mail trigger routine
In a Grok Bot conversation, tell the assistant: "Create an email mailbox for yourself with the name xxx" (you may offer several alternatives). The assistant checks availability and provisions [email protected]. Then say: "Wake me up immediately when mail arrives at this mailbox." The assistant will create an "incoming mail triggers routine" task. Note: each user gets only one Grok mailbox, it is permanent after creation, so choose the name carefully. The [email protected] format is supported for separating different uses.
Create a Google Cloud OAuth app and authorize each Gmail account
In Google Cloud Console, create an OAuth app (the author named it "Gmail Forward Filter"), enable Gmail-related permissions, and publish the consent screen to production (test-mode auth expires in 7 days). Each Gmail account needs to click "authorize" once to obtain a long-lived token; store tokens only on the Grok cloud computer locally, not in git. Tokens become invalid only if the password is changed or the authorization is revoked in the Google Account settings.
Route A: Gmail sender-based forwarding to Grok mailbox
In Gmail web settings → Forwarding and POP/IMAP, add the Grok mailbox as a forwarding address. This is done once per Gmail account; phone confirmation of identity is required. Google sends a confirmation email to the Grok mailbox—have the assistant click the confirmation link. Keep the global forwarder disabled; create a filter only: emails from a specific sender → forward to Grok mailbox. The result is that replies arrive at the Grok mailbox almost instantly and trigger the assistant.
Route B: Scheduled script on Grok cloud computer to check mail and send alerts
For Gmail accounts that cannot add a forwarding address (the author encountered this with three accounts with no stated reason), deploy a scheduled script on the Grok cloud computer (the author used Cursor to write it) that checks for new mail from specified senders every 3 minutes. When new mail is found, the script sends an alert email to the Grok mailbox, triggering the assistant report. The script runs autonomously without waking the assistant and consumes no Grok quota. Note: after a cloud computer restart or update, verify that scheduled tasks are still running.
Daily use: add or remove watched contacts
To watch a contact, tell the assistant "watch this person." The assistant checks the account route: for forward-capable accounts it adds a sender filter; for non-forward accounts it adds the contact to the script watchlist. When the contact replies, the assistant reports immediately and drafts a response, but the send button is always pressed by the user. When the matter is concluded, tell the assistant to remove the watch; it deletes the filter or removes from the list, returning to normal polling.
Prompt you can copy
Reference prompt · Editorial suggestion。Confirm the destination, input variables and output format before use.
This block is the prompt. Ads are never placed here.
No prompt needed — just follow the steps.
Use natural-language commands directly in Grok Bot conversation; no preset prompt template is required.
Source
(中文)Grok 专属邮箱做中转:claim 邮箱→来信即叫醒→Gmail 按发件人转发实现秒回 · william40152988 · X · 2026-10-21T15:43:43.000Z
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.