Problem
When using gog gmail watch serve with a webhook integration, all Gmail history events are forwarded:
messagesAdded
messagesDeleted
labelsAdded
labelsRemoved
For most use cases (e.g., processing new emails), only messagesAdded events are relevant. Receiving notifications for deletions, archive operations, and label changes creates unnecessary webhook traffic and processing overhead.
Proposed Solution
Add a --history-types flag to gog gmail watch serve:
gog gmail watch serve \
--history-types messagesAdded \
--hook-url http://localhost:18789/hooks/gmail \
...
The Gmail API's history.list endpoint already supports filtering via the historyTypes parameter. This would just expose that capability.
Supported values: messageAdded, messageDeleted, labelAdded, labelRemoved
Default behavior: All types (current behavior, for backwards compatibility)
Use Case
Integrating with OpenClaw for AI-assisted email processing - only want to process new incoming emails, not deletions/archives.
Problem
When using
gog gmail watch servewith a webhook integration, all Gmail history events are forwarded:messagesAddedmessagesDeletedlabelsAddedlabelsRemovedFor most use cases (e.g., processing new emails), only
messagesAddedevents are relevant. Receiving notifications for deletions, archive operations, and label changes creates unnecessary webhook traffic and processing overhead.Proposed Solution
Add a
--history-typesflag togog gmail watch serve:The Gmail API's history.list endpoint already supports filtering via the
historyTypesparameter. This would just expose that capability.Supported values:
messageAdded,messageDeleted,labelAdded,labelRemovedDefault behavior: All types (current behavior, for backwards compatibility)
Use Case
Integrating with OpenClaw for AI-assisted email processing - only want to process new incoming emails, not deletions/archives.