skills/gmail/SKILL.md
Read and send emails via [email protected] using Gmail IMAP/SMTP
npx skillsauth add ariffazil/openclaw-workspace gmailInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Any task involving email — read inbox, send message, search emails, check unread.
Stored in: /root/AAA/secrets/email.env (mode 600)
Also available as env vars: GMAIL_USER, GMAIL_APP_PASSWORD
import imaplib, email, os
from email.header import decode_header
user = os.environ.get("GMAIL_USER", "[email protected]")
password = os.environ.get("GMAIL_APP_PASSWORD", "")
mail = imaplib.IMAP4_SSL("imap.gmail.com")
mail.login(user, password)
mail.select("INBOX")
# Fetch last 10 emails
_, msgs = mail.search(None, "ALL")
ids = msgs[0].split()
for uid in ids[-10:]:
_, data = mail.fetch(uid, "(RFC822)")
msg = email.message_from_bytes(data[0][1])
subject = msg["Subject"]
sender = msg["From"]
date = msg["Date"]
print(f"{date} | {sender} | {subject}")
mail.logout()
import smtplib, os
from email.message import EmailMessage
user = os.environ.get("GMAIL_USER", "[email protected]")
password = os.environ.get("GMAIL_APP_PASSWORD", "")
msg = EmailMessage()
msg["From"] = user
msg["To"] = "[email protected]"
msg["Subject"] = "Subject here"
msg.set_content("Body text here")
with smtplib.SMTP("smtp.gmail.com", 587) as server:
server.starttls()
server.login(user, password)
server.send_message(msg)
# Unread only
mail.select("INBOX")
_, msgs = mail.search(None, "UNSEEN")
# Search by subject
_, msgs = mail.search(None, 'SUBJECT "keyword"')
# Search by sender
_, msgs = mail.search(None, 'FROM "[email protected]"')
All outgoing emails show From: [email protected] — no alias support via IMAP/SMTP.
If you need to send from [email protected], requires Cloudflare/Resend API instead.
development
Check every skill’s “use when” and “do not use when” clauses for collisions, missing negatives, and vague verbs like “help,” “assist,” or “improve.” Load when linting, reviewing, or validating trigger boundaries.
development
Bootstrap, design, and package new skills. Load when capturing user intent for a new skill or drafting its initial instruction framework.
content-media
Diagnose which federation services are up, down, or drifting. Produce a prioritized remediation plan.
business
Scan a repo or workspace for exposed secrets, tokens, keys, and credentials. Produce a findings report with remediation steps.