Email Inbox Zero

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

Install Gmail skill
clawhub install gmail-reader

This 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

  1. Go to console.cloud.google.com and create a project (or reuse an existing one)
  2. Enable the Gmail API in the API Library
  3. Go to Google Auth Platform > Clients, create an OAuth 2.0 Client ID (Desktop app type)
  4. Download the credentials JSON file
  5. 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 labels
  • gmail.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:

Authorize Gmail access
openclaw skill auth gmail-reader

This 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:

Test email access
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:

ProviderHostPort
Gmailimap.gmail.com993
Outlookoutlook.office365.com993
Yahooimap.mail.yahoo.com993
Fastmailimap.fastmail.com993
ProtonMail127.0.0.1 (Bridge)1143

ProtonMail requires the ProtonMail Bridge app running locally.

List installed skills
clawhub list

This shows all installed skills and their authentication status.

Knowledge Check

Which Gmail API scope is needed to read emails?