# Gmail SMTP Setup for Himalaya

Gmail-specific app-password and folder-alias configuration.

## Prerequisites

- A Gmail account
- 2-Step Verification enabled (required for App Passwords)
- An App Password generated at https://myaccount.google.com/apppasswords

## Minimal config.toml

```toml
[accounts.gmail]
email = "you@gmail.com"
display-name = "Your Name"
default = true

backend.type = "imap"
backend.host = "imap.gmail.com"
backend.port = 993
backend.encryption.type = "tls"
backend.login = "you@gmail.com"
backend.auth.type = "password"
backend.auth.cmd = "pass show google/app-password"

message.send.backend.type = "smtp"
message.send.backend.host = "smtp.gmail.com"
message.send.backend.port = 587
message.send.backend.encryption.type = "start-tls"
message.send.backend.login = "you@gmail.com"
message.send.backend.auth.type = "password"
message.send.backend.auth.cmd = "pass show google/app-password"

folder.aliases.inbox = "INBOX"
folder.aliases.sent = "[Gmail]/Sent Mail"
folder.aliases.drafts = "[Gmail]/Drafts"
folder.aliases.trash = "[Gmail]/Trash"
```

## Why the folder aliases matter

Gmail's Sent folder is `[Gmail]/Sent Mail`, not `Sent`. Without the alias,
`himalaya message send` will successfully deliver via SMTP, fail to save to
Sent, and exit non-zero. Any caller that retries on the error code will re-run
the entire send — including SMTP — and duplicate the email. Always include the
`folder.aliases` block for Gmail.

## Sending a test message

```bash
cat << 'EOF' | himalaya template send
From: you@gmail.com
To: test@example.com
Subject: Himalaya test

Test message from Himalaya.
EOF
```

## See also

- `references/configuration.md` for general Himalaya configuration.
- `job-search-toolkit` for composing outreach emails, cover letters, and follow-ups.
