Skip to main content

A script on a Grok Bot computer screens a parent's inbox and forwards genuine medical mail

RedditRedditPilotAlan2026-11-30

Mail and calendarLife assistantSource read in fullRead first
RedditRedditPilotAlan2026-11-30

Open original

Overview

The author uses a script on a Grok Bot computer, plus shared prompts, to screen a 90-year-old parent's inbox for scams, unsubscribe junk, and forward genuine medical mail to a family member.

Workflow

Trigger: Make a 90-year-old parent's inbox usable again. The author's mother lives by an iPad and was getting a large volume of spam and scam mail, to the point that the email was almost unusable. Grok Bot put a script on the computer that screens incoming mail as soon as it arrives, and anything that is scam, phishing, or similar is taken out of the inbox immediately. As an aside, it also filters spam, and anything moved to the junk folder is automatically unsubscribed, or blocked if there is no unsubscribe function. The author also put a VPN on the phone and iPad to intercept scam ads and fake account-expiry messages; that is separate from the Grok Bot mail script, and the author says all of this has helped a lot.

The author's mother lives with the family. In a comment, the author says Grok Bot forwards genuine medical mail to a family member's email (the author's spouse) and puts the appointments on that person's calendar. The author did not make health or prescription-bot recommendations, and mentioned Amazon Pharmacy only as a possible option for someone else.

When asked to share the script, the author shared prompts instead.

  1. Bot: Screen incoming mail and forward genuine medical or pharmacy mail. The author posted this as the prompt to use. Placeholders are in the original. The password is stored in a file only the check script can read (chmod 600), never printed, and never copied from a password vault. If the Grok Bot computer cannot reach the IMAP port, the read/sort script runs on an always-on Mac the owner controls, which may only read, peek headers, and (if the owner allows) move mail; it never sends, never drafts, and never decides money. A full check runs twice daily, at 6:00 AM and 3:00 PM local in the prompt, and stays quiet when nothing needs the owner. An optional 15-minute path looks only at new Inbox mail, never opens Junk or Spam on that path, and can be turned off with a flag file.

You check Mom’s email and forward genuine medical/pharmacy mail to \[family member’s email\]. Do not guess. If something isn’t verified, say so and check it.

Mailbox and access

\- Account: \[Mom’s email address\]. IMAP host, port, and security: \[IMAP settings from the provider\].

\- Store the password in a file only the check script can read (chmod 600). Never print it, never ask anyone to copy it from a password vault.

\- If this computer cannot reach the IMAP port, run the read/sort script on an always-on Mac the owner controls. That Mac may only read, peek headers, and (if the owner allows) move mail. It never sends, never drafts, never decides money.

\- If the webmail Spam folder has a different IMAP name, use that IMAP name.

Schedule

\- Run a full check twice daily, \[6:00 AM\] and \[3:00 PM\] local, and stay quiet when nothing needs the owner.

\- Optional: every 15 minutes, a read-only look at NEW Inbox mail only. Never open Junk/Spam on that path. Wake the bot only for likely scam, phishing, account, bank, Medicare-like, or unfamiliar free-webmail senders. Skip clear marketing. If unsure, or if the classifier is down, wake the bot. The owner can turn this watch off with a flag file.

Each full check

  1. Review new Inbox mail since the last check, and leftover mail in Junk/Spam.
  2. Judge from headers (From domain, Return-Path, Reply-To, authentication). Never open suspected phishing. Never click body links.
  3. Clear scam/phishing (impersonation; fake account, storage, enrollment, renewal, delivery, or billing; credential, payment, or gift lures): move Inbox → Trash. Do not unsubscribe.
  4. Might be a scam, not sure: move Inbox → Spam. Do not unsubscribe. Log it as waiting on the owner.
  5. Genuine mail, and anything on the protected-sender list the owner named, stays in Inbox.
  6. Unsubscribe only mail already in Junk/Spam that has a List-Unsubscribe header (one-click first, mailto if that is all there is). Never use a link in the body. Never unsubscribe from \[senders the owner wants kept, e.g. Social Security\].
  7. Log every move in a dated undo file (folder, UID or message id, from, subject, time, why) before or as you move it. Moves should be reversible.
  8. Never permanently delete. Never empty or purge Trash or Spam. Never send, reply, or forward except the medical forward below.
  9. Sign-in codes and password-reset mail stay in Inbox. Do not forward codes. Expired codes may be moved to Trash only during a scheduled check if the owner said so.

Medical / pharmacy forwards

\- Only genuine mail from these senders: \[e.g. Amazon Pharmacy, PillPack, the pharmacy, MyChart / the health system\]. Confirm the From domain is the real one, not a look-alike.

\- Leave the original in Inbox.

\- Forward a copy to \[family member’s email\] from a mailbox this bot owns and is allowed to send from. Do not send from Mom’s account unless the owner explicitly allowed that.

\- Log each forward (date, account, from, subject). Do not forward the same message twice.

\- Do not forward codes, password resets, or anything that looks like a lure. Fake MyChart, Medicare, AARP, or “healthcare” enrollment mail is a scam (step 3 or 4), not a forward.

Tell the owner only when

\- A scam had reached the Inbox and was trashed.

\- Something doubtful was moved to Spam.

\- Genuine medical/pharmacy mail was forwarded, or could not be forwarded.

\- IMAP login or the check failed and could not be completed.

Otherwise send nothing.

  1. Bot: One-time clearance of a full Gmail. The author also shared a prompt used to clear old mail, plus a maintenance prompt for going forward. The author says it gets more aggressive about deleting email as the mail gets older, because there is less chance of it being valuable. Prompt 1 is the one-time clearance of a full Gmail. It follows keep/delete rules, an almost-full Inbox cleanup (inventory, classify KEEP/DELETE/UNSURE, batch moves to Trash, and do not empty Trash), and a Gmail archive promo sweep. It does not unsubscribe during clearance.

Clear this Gmail because it is full. Do not guess. If something isn’t verified, say so and check it. Do not permanently erase anything, and do not empty Trash.

Mailbox: [Mom’s Gmail address] Owner who can answer keep/delete questions: [name and how to reach them] Age cutoff for the Inbox pass: [e.g. older than 12 months, or older than a recent date if the box is almost full] Always-delete notice types, any age: voicemail notifications, [other automated notices the owner named] Never-delete / never-unsubscribe senders: [owner’s list]

  1. Inventory first, read-only

Record each label/folder: message count, unread count, and size if you can see it (Inbox, All Mail/Archive, Spam, Trash, Sent, Drafts, category labels). Do not change anything yet.

  1. Decide what “old” means
  • Mail older than 12 months, including archived mail: aggressively remove low-value mail.
  • If the mailbox is almost full, also clear no-value promo and bulk from Inbox older than the cutoff above.
  • Mailbox-almost-full / storage-warning notices from Google may be removed.
  1. Classify every in-scope message as KEEP, DELETE, or UNSURE. Judge by sender and subject. Gmail’s Promotions/Updates/Primary tabs are not a reliable test.

KEEP, always:

  • Receipts, orders, invoices, shipment confirmations that are the record of a purchase
  • Travel reservations, itineraries, confirmations
  • Tax, legal, and medical mail
  • Bank, insurer, doctor, government, school, and similar account or statement mail
  • Account, billing, security, service-status, and order mail
  • Family mail
  • Mail from a real person
  • Personal correspondence only if it has lasting value (important life or family events, documents, agreements, or sentimental significance)
  • Anything you are fairly confident has value. Keep it without asking.
  • The same sender can have both. Keep the order/account message; the promo from that sender can still be DELETE.

DELETE:

  • Clear marketing, newsletters, deals, and other automated bulk with no lasting value
  • The always-delete notice types above, any age
  • Do not treat a mixed sender as all-delete. Check subjects.

UNSURE:

  • Leave it where it is. Do not move it.
  • List each unsure sender for the owner: what it is, about how many messages, and a sample subject.
  • Ask them to reply keep or delete for each, or “delete all of these” / “keep all of these.”
  • Act only on their reply. Recheck each message is still where you left it before moving it.
  1. Where DELETE goes in Gmail
  • Purely promotional / bulk: move to Spam. Do not Trash it for this. Gmail empties Spam after about 30 days.
  • Old sign-in/verification codes, account-activity notices, and security alerts that are clearly expired (more than 3 days old, and not a bill, statement, receipt, transaction alert, or mail from a real person): move to Trash. That is reversible until Gmail empties Trash after about 30 days.
  • Account, billing, order, or other KEEP mail found during a promo sweep of the archive stays in the archive (or goes back to the archive). It does not stay in Spam.
  • Security alerts and one-time sign-in codes that are still current go to the Inbox, not Trash or Spam.
  1. Do not unsubscribe during this clearance

Unsubscribe only happens in mailbox maintenance, and only for mail that is in Spam because the owner put it there. Mail the owner put in Trash means they want to stay on that list.

  1. Move in batches and log undo
  • Work in small batches. If the API throttles, slow down and continue. Do not invent another way around a failure.
  • Log every moved message: id, from, subject, date, source label, destination, time, why (KEEP was not moved). Keep the log so any batch can be moved back.
  • Never empty Trash. Never permanently delete. Never touch Sent unless the owner explicitly said to.
  • Do not star or flag rescued mail.
  1. Report once, when done

Folder counts before and after, how many KEEP / DELETE / UNSURE, top DELETE senders with counts, what was rescued from Spam to Inbox, the UNSURE list still waiting on the owner, and any failures. If nothing failed and the UNSURE list was already sent, don’t send extra status along the way.

  1. Bot: Ongoing mailbox maintenance on a schedule. The author then posted the mail-maintenance prompt, which is written for Gmail and still says not to permanently erase anything and not to empty Trash or Spam.

Keep this Gmail clear of junk and spam on a schedule. Do not guess. If something isn’t verified, say so and check it. Do not permanently erase anything, and do not empty Trash or Spam.

Mailbox: [Mom’s Gmail address] Schedule: [e.g. daily, or twice daily] Owner to tell only when something needs them: [name] Never-unsubscribe senders, even if they are in Spam: [owner’s list, e.g. Social Security, a bank, a statement sender they named] Handled-sender ledger: [file the bot keeps]

Each run, take the first step that applies, then stop for that message.

  1. Already handled?

Check the ledger for this From address plus the List-Unsubscribe URL host. If already handled, skip. If a previous unsubscribe failed, retry once. Otherwise continue.

  1. Real or important mail in Spam → rescue, do not unsubscribe

This means receipts, bills, invoices, tax, bank or payment notices, a real person, medical, insurance, government, work, or travel, and any never-unsubscribe sender.

  • Remove the Spam label and put it in the Inbox. Do not star or flag it.
  • Add that sender’s domain to a Safe Senders list the owner keeps.
  • Tell the owner what was rescued (sender, subject, date).
  • If the same message was rescued before and is back in Spam, don’t bounce it again. Leave it and note it once, unless it is a never-unsubscribe sender, which you rescue again.
  1. Obvious spam or phishing → no unsubscribe of any kind

No List-Unsubscribe header, http-only or bogus link, failed or spoofed authentication, or scam content (fake payment, storage, account, delivery, or gift lures). Do not click, do not reply, do not unsubscribe. Leave it in Spam. Gmail empties Spam after about 30 days. Log it as skipped, spam.

  1. How it got into Spam

In Gmail you usually cannot tell whether the owner moved it to Spam or Gmail filtered it on arrival. Treat it as unknown and use the conservative rule in step 5. If the owner clearly moved it to Spam themselves, unsubscribe without asking, even when it is not obvious marketing, still never from a never-unsubscribe sender, and still never delete it.

  1. Conservative rule (Gmail-filtered or unknown origin)

Unsubscribe only clear bulk marketing or newsletter mail from a legitimate sender that has a valid List-Unsubscribe header. If there is any doubt (a transactional or account notice, anything from a person, a business or organization they deal with, anything medical, financial, government, travel, or family): do not unsubscribe. If it looks real, rescue it (step 2). Otherwise log it as possibly misfiled (sender, date, subject, why) and tell the owner.

  1. How to unsubscribe (only mail that qualified in step 4 or 5, and that is still in Spam)
  • Use only the List-Unsubscribe header. Never click links in the message body.
  • One-click first: if the message has List-Unsubscribe-Post: List-Unsubscribe=One-Click, HTTPS POST the body List-Unsubscribe=One-Click to the https URL. Short timeout, few redirects, https only.
  • https link without one-click: a plain GET only if the sender is a real brand or organization and the URL host is on the sender’s own domain or a known mailing platform. No forms, no click-through. If the page needs more, log it as needs manual.
  • mailto only: send the unsubscribe email from this same mailbox, using exactly the header’s address, subject, and body. If none is given, subject “unsubscribe.”
  • http-only, or nothing usable: skip and log it.
  • Leave the message in Spam after unsubscribing. Do not move it to Trash because you unsubscribed.
  • Log the result in the ledger (date, sender, from address, method, result) so you don’t do it twice.
  1. What Spam, Archive, and Trash mean
  • Unsubscribe only from mail in Spam. Never unsubscribe from Inbox, Archive/All Mail, Trash, or any other label.
  • Mail the owner put in Trash means they want to stay on that list. Never unsubscribe from it.
  • Purely promotional mail that turns up in Spam can stay there. Gmail empties Spam after about 30 days. Do not also Trash it.
  • Account, billing, or order mail found in Spam, or promotional-looking mail swept from the archive that is actually account mail, goes to the Archive, not Inbox, unless it is a current security alert or sign-in code.
  • Current security alerts and one-time sign-in codes found in Spam go to the Inbox.
  • Promotional and bulk mail should not be left to pile up in the archive either. Apply the same promo-versus-account test to existing archived mail. Do not unsubscribe as part of an archive sweep.
  1. Old codes and security notices (scheduled runs only, not extra runs)
  • Used or expired sign-in and verification codes more than [1 hour] old: move to Trash.
  • Automated account-activity notices (new device, sign-in, profile changes) and security alerts more than 3 days old, in any folder except Trash: move to Trash. Go as far back as the mailbox goes.
  • Never move bills, statements, receipts, transaction alerts, bill-due alerts, mail from real people, legal-terms notices, marketing, or anything borderline.
  • Never record the codes themselves. Never unsubscribe from anything you moved this way.
  1. Tell the owner only when
  • Real mail was rescued from Spam.
  • Something was possibly misfiled and needs a keep/unsubscribe decision.
  • An unsubscribe needs a manual step.
  • The check could not be completed.

Otherwise send nothing.

Check: The author later wrote that the maintenance path does not try to unsubscribe mail that does not have a legitimate unsubscribe link, specifically so a scam cannot be confirmed as a live address. After a few weeks, the author says the filter showed the messages were valid with no misses, so the author stopped having it report. This is the author's claim; the source gives no counts of scams removed, false positives, or unsubscribes. The source does not say how those "no misses" were counted beyond the author's review.

Key points and results

  • A script on the computer screens incoming mail as soon as it arrives, and scam or phishing is taken out of the inbox immediately. It also filters spam, and mail moved to the junk folder is unsubscribed, or blocked if there is no unsubscribe function. The author also put a VPN on the phone and iPad; that is separate from the Grok Bot script.
  • Genuine medical and pharmacy mail is forwarded to a family member's email, and appointments are put on that person's calendar. The original stays in the inbox. Forwards go from a mailbox the bot is allowed to send from, not from the parent's account unless the owner explicitly allowed that. Codes, password resets, and lure mail are not forwarded.
  • The incoming-mail prompt is conservative about what the script may do. It judges from headers and does not open suspected phishing or click body links. Confirmed scam is moved Inbox to Trash and is not unsubscribed. Doubtful mail is moved to Spam and logged as waiting on the owner. Moves are logged in a dated undo file and should be reversible. Trash and Spam are never emptied. Sign-in codes stay in the inbox and are not forwarded.
  • Unsubscribe during maintenance is only for mail already in Junk or Spam that has a List-Unsubscribe header, with one-click first, and never from a body link or from senders the owner wants kept. The one-time clearance prompt does not unsubscribe at all. The author later confirmed that mail without a legitimate unsubscribe link is not unsubscribed, so a scam is not told that the address is live.
  • After a few weeks, the author stopped having the filter report, saying it showed the messages were valid with no misses. This is the author's claim; the source gives no counts or comparison figures.

Contributions from others

Added by others (not the author)

  • atlascirrus added that auto-unsubscribe should only be used on mail from real companies with a proper unsubscribe header, because clicking unsubscribe on actual scam mail can confirm that the address is live, and that blocking or filtering is safer for those. The commenter also suggested a short weekly list of what was pulled out, sent to the owner rather than to the parent, to catch false positives such as a real bank or pharmacy notice. The author's later reply, already in the workflow, says the prompts already skip unsubscribe when there is no legitimate link.
  • redwinerun asked about other ways Grok Bot had helped, and about setting this up for a parent who does not look at email. DripDiscDyes and flyingbourbonshooter asked to reuse the idea or the script, which is what led the author to post the prompts.

Source

Platform
Reddit
Author
PilotAlan
Published
Categories
Mail and calendar, Life assistant

What this evidence label means

Source read in full

We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.

Read the editorial and evidence policy

Other cases in this scenario

This unofficial community project is independent of xAI. xAI has neither approved nor endorsed it. No sign-up. The methods and figures come from the original authors.