Skip to content
Back to skills

Gmail

ASecurity

Read, search, and send Gmail emails. Use when the user mentions email, inbox, Gmail, or asks to check/send messages.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 9, 2026
ai-agentspythongoshellbash

Security analysis

A100/100

Scanned October 9, 2026

npx -y skills add julienR2/jarvis --skill gmail --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gmail?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gmail
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/julienr2-gmail/badge)](https://www.skillsdirectory.com/skills/julienr2-gmail)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gmail
description: Read, search, and send Gmail emails. Use when the user mentions email, inbox, Gmail, or asks to check/send messages.
allowed-tools: Bash, Read, Write
---

# Gmail Skill

Access Gmail via IMAP (read/search) and SMTP (send).

## Credentials

Uses the **`gmail`** connector → sets `$GMAIL_ADDRESS`, `$GMAIL_APP_PASSWORD`. Load them per *Connectors* in CLAUDE.md, in the same shell block as the commands that use them.

- **IMAP:** `imaps://imap.gmail.com:993`
- **SMTP:** `smtp://smtp.gmail.com:587` (STARTTLS)

---

## Read / Search emails (IMAP via curl)

### List latest emails in INBOX

```bash
curl -s --url "imaps://imap.gmail.com:993/INBOX" \
  --user "${GMAIL_ADDRESS}:${GMAIL_APP_PASSWORD}" \
  -X "FETCH 1:10 (ENVELOPE)"
```

### Search unread emails

```bash
curl -s --url "imaps://imap.gmail.com:993/INBOX" \
  --user "${GMAIL_ADDRESS}:${GMAIL_APP_PASSWORD}" \
  -X 'SEARCH UNSEEN'
```

### Fetch a specific message by UID

```bash
curl -s --url "imaps://imap.gmail.com:993/INBOX;UID=<uid>" \
  --user "${GMAIL_ADDRESS}:${GMAIL_APP_PASSWORD}" \
  -X "UID FETCH <uid> (BODY[])"
```

---

## Better approach: Python script

For anything beyond simple listing, use Python (available in the container):

```python
import imaplib, email

GMAIL = "${GMAIL_ADDRESS}"
APP_PW = "${GMAIL_APP_PASSWORD}"

mail = imaplib.IMAP4_SSL("imap.gmail.com")
mail.login(GMAIL, APP_PW)
mail.select("INBOX")

# Search — e.g. unseen
status, data = mail.search(None, "UNSEEN")
uids = data[0].split()

for uid in uids[-10:]:  # last 10
    _, msg_data = mail.fetch(uid, "(RFC822)")
    msg = email.message_from_bytes(msg_data[0][1])
    print(msg["Subject"], "|", msg["From"])

mail.logout()
```

Run with: `python3 /tmp/gmail_read.py`

---

## Send email (SMTP via Python)

```python
import smtplib
from email.mime.text import MIMEText

GMAIL = "${GMAIL_ADDRESS}"
APP_PW = "${GMAIL_APP_PASSWORD}"

msg = MIMEText("Body here")
msg["Subject"] = "Subject here"
msg["From"] = GMAIL
msg["To"] = "recipient@example.com"

with smtplib.SMTP("smtp.gmail.com", 587) as smtp:
    smtp.starttls()
    smtp.login(GMAIL, APP_PW)
    smtp.send_message(msg)
```

---

## Common use cases

| Task | Method |
|---|---|
| List unread emails | IMAP SEARCH UNSEEN |
| Read full email body | IMAP FETCH by UID |
| Search by subject/sender | IMAP SEARCH with criteria |
| Send an email | SMTP with MIMEText |
| List folders/labels | IMAP LIST |

## Notes

- Gmail folders use special names: `[Gmail]/Sent Mail`, `[Gmail]/Trash`, `[Gmail]/All Mail`, `[Gmail]/Starred`
- Spaces in app password are fine — Gmail ignores them
- Always close the IMAP connection after use (`mail.logout()`)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.