Lesson 2 of 4
Connecting Your Email
Estimated time: 5 minutes
Connecting Your Email
Before OpenClaw can triage your inbox, it needs read access to your email. OpenClaw supports Gmail and Outlook through ClawHub skills — the same plugin system you may have used in the Morning Briefing course.
Install the email skill
clawhub install gmail-readerThis skill uses the Gmail API with OAuth 2.0 — it reads messages but never sends or deletes anything unless you explicitly enable those permissions later.
Authenticate your account
- Go to console.cloud.google.com and create a project (or reuse an existing one)
- Enable the Gmail API in the API Library
- Go to Google Auth Platform > Clients, create an OAuth 2.0 Client ID (Desktop app type)
- Download the credentials JSON file
- Place it at
~/.openclaw/google-credentials.json
If you already set this up for Google Calendar in the Morning Briefing course, you can reuse the same credentials — just add the Gmail scope.
The gmail-reader skill requests these scopes:
gmail.readonly— read messages and labelsgmail.labels— manage labels (for auto-categorization)
It does not request gmail.send or gmail.modify. Those are only needed if you enable auto-responses later in Lesson 4.
Run the authorization flow:
openclaw skill auth gmail-readerThis opens a browser window. Sign in with your Google account and grant access. After authorization, OpenClaw stores a refresh token locally.
Verify the connection
Test that OpenClaw can read your inbox:
openclaw run "List the subject lines of my 5 most recent emails"You should see your latest email subjects in the response. If you get an error, check the troubleshooting section below.
Troubleshooting
This usually means your Google Cloud project is in "Testing" mode. Go to the OAuth consent screen in Google Cloud Console and add your email address as a test user. For personal use, you don't need to publish the app.
Make sure you added Mail.Read permission (not Mail.ReadBasic) and that an admin has granted consent. For personal accounts, consent is granted during the auth flow.
Double-check your IMAP host and port. Common values:
| Provider | Host | Port |
|---|---|---|
| Gmail | imap.gmail.com | 993 |
| Outlook | outlook.office365.com | 993 |
| Yahoo | imap.mail.yahoo.com | 993 |
| Fastmail | imap.fastmail.com | 993 |
| ProtonMail | 127.0.0.1 (Bridge) | 1143 |
ProtonMail requires the ProtonMail Bridge app running locally.
clawhub listThis shows all installed skills and their authentication status.
Which Gmail API scope is needed to read emails?