Wiki · Features in depth

Email and calendar

The agent can have an address of its own and access to your calendar. Here is how to set it up, who may write to it and what to watch out for.

✅ Verified 17. 10. 2026Source: official documentation →📋 Copy for your AI
📬
Email is a full communication channel for the agent, not just a way to read mail. You can write to it from your phone like a colleague, it answers and does the work meanwhile. An address of its own is set up separately from access to your calendar — two different things.

Three ways to give the agent email

WayWhat it doesWhat you need
Email as a channel (gateway)You write to an address, the agent replies; works for scheduled jobs tooAn address, IMAP and SMTP access, an app password
Own address + HimalayaThe agent checks the inbox and sends mail itself, with no always-on botA dedicated mail account and the Himalaya tool
Google WorkspaceGmail, Calendar, Drive, Sheets, Docs and ContactsA Google Cloud project and a one-off OAuth sign-in

If you want email only, pick the channel or Himalaya — that is a matter of minutes. Google Workspace is for the calendar, Drive and Docs, but it needs a Google Cloud project and an approval step.

Email as a channel: setup

  1. Run the wizard and pick Email (it walks you through everything):

    ❯ hermes gateway setup
  2. Or set it by hand in ~/.hermes/.env — four required values:

    # ~/.hermes/.env EMAIL_ADDRESS=agent@yourdomain.com EMAIL_PASSWORD=app-password # note: not your regular password! EMAIL_IMAP_HOST=imap.yourdomain.com EMAIL_SMTP_HOST=smtp.yourdomain.com
  3. Add who may write to it, plus the receiving server's identity (see below — it is a safety catch):

    # who may write to the agent (others are ignored) EMAIL_ALLOWED_USERS=you@yourdomain.com,colleague@company.com # the authserv-id your receiving server stamps into message headers EMAIL_AUTHSERV_ID=mx.google.com
  4. Keep it running — in the foreground, or as a service that starts with the machine:

    ❯ hermes gateway # runs in the foreground ❯ hermes gateway install # as a service
ValueDefaultWhat it is for
EMAIL_IMAP_PORT993Receiving mail (encrypted connection)
EMAIL_SMTP_PORT587Sending mail
EMAIL_POLL_INTERVAL15 secondsHow often the inbox is checked
EMAIL_HOME_ADDRESS—Where output from scheduled jobs is delivered

On startup the agent marks every message already in the inbox as seen and processes only new mail. Expect the history to be ignored the first time you start the email channel.

Who may write to the agent

SettingWhat happens
An allowlist is setOnly messages from those addresses are processed
No allowlistUnknown senders are silently ignored — they get no reply at all
Mode pairAn unknown sender receives a pairing code (they can be added)
Mode declineAn unknown sender gets one polite refusal, then nothing for 24 hours

Sender authentication: the agent only acts when the server that received the message confirms that it genuinely came from the stated domain (DMARC or aligned SPF/DKIM). That is why EMAIL_AUTHSERV_ID exists — it must match exactly what your receiving server writes into the headers. Without it, the From: header can be forged and the agent would take orders from a stranger.

Calendar and other Google services

The calendar is not handled through email but through a ready-made Google Workspace workflow, which also covers Gmail, Drive, Sheets, Docs and Contacts. Setup is a one-off and the agent guides you:

❯ Set up Google Workspace for me.
  1. A Google Cloud project is created and the required APIs are enabled (Gmail, Calendar, Drive, Sheets, Docs, Contacts).
  2. Desktop-app OAuth credentials are created and the client secret file is downloaded.
  3. The agent generates a sign-in URL — you approve it in the browser and paste the redirect URL back.
  4. From then on the token refreshes itself.

Working with the calendar then looks like this (you just ask in the conversation):

❯ What meetings do I have tomorrow? ❯ Book a 30-minute consultation with Jan on Thursday from 10:00 and invite him.

Watch the timezone. The calendar requires a timezone offset (+02:00 for Czech summer time, for example) or a UTC time. When the offset is missing, the time is taken as UTC — and your meeting lands two hours off.

Pitfalls from our systems

What happenedWhat to do
The agent processed no messagesUsually EMAIL_AUTHSERV_ID does not match what your server writes, or the address is not on the allowlist. Both show up in the service log
Replies never arrivedWith your own domain, SPF, DKIM and DMARC must be correct. Without them mail lands in spam or is dropped
The agent obeyed a strangerNever use an "allow everyone" mode. The allowlist is what protects you
Sign-in stopped working after a password changeThe app password must be updated in the settings too — some providers make you generate a new one
A meeting was booked two hours offThe timezone offset was missing. Always state the time with its offset, or ask how the agent understood it before writing
Hundreds of old emails sat in the inbox and the agent ignored themThat is correct — history is marked as seen at startup. Forward an older message again if you need it handled

Our tips

TipWhy
Give the agent an address of its ownIt stays out of your work mail and you keep a clear allowlist
Write a meaningful subjectThe agent recognises the task better and you keep threads readable
Treat email like a letter, not a chatIt is more public and slower — sensitive things belong in chat or the terminal
Send scheduled jobs to one addressSet EMAIL_HOME_ADDRESS and your morning digests arrive reliably
Try one email before rolling it outYou verify sender authentication and replies before building on it

Where next

← Back to the wiki