Files
openclaw/extensions/imap/openclaw.plugin.json
Peter Steinberger 87b56458a1 feat(plugins): inbound IMAP email trigger (#130230)
* feat(plugin-sdk): add in-process hook agent dispatch seam

* feat(plugins): add imap inbound email trigger plugin

* fix(imap): coalesce sweep wakeups and drop test-only gate exports

* docs(imap): fix agents bindings command invocation

* fix(gateway): guard optional bound context in plugin hook dispatch

Post-rebase drift made resolveBoundGatewayContext possibly-undefined; the
plugin hook dispatch path invoked it unconditionally. Use the optional-call
guard consistent with sibling runtime accessors.

* fix(imap): bump mailparser to 3.9.16 off vulnerable deepmerge-ts

mailparser 3.9.15 pinned html-to-text@10.0.0 -> deepmerge-ts@7.1.6 (GHSA
HIGH, stack exhaustion, <8.0.0). 3.9.16 pins html-to-text@10.0.1 ->
deepmerge-ts@8.0.2, clearing the production audit gate.

* refactor(gateway): extract plugin hooks runtime to keep server-plugins under max-lines

The dispatchHookAgentTurn seam pushed server-plugins.ts to 702 effective lines
(cap 700). Extract createGatewayHooksRuntime into the sibling runtime-helpers
module, mirroring createGatewayNodesRuntime/createGatewaySubagentRuntime; no
suppression added.

* docs(secrets): register imap plugin password in secretref credential matrix

The bundled imap plugin declares a secretInput (accounts.*.password); regenerate
the user-supplied credentials matrix and surface list so the target-registry docs
sync test stays green.
2026-08-26 12:24:02 -07:00

106 lines
4.3 KiB
JSON

{
"id": "imap",
"name": "IMAP email trigger",
"description": "Watch IMAP mailboxes and dispatch authenticated incoming email to isolated agent sessions.",
"activation": { "onStartup": true },
"enabledByDefault": false,
"configContracts": {
"secretInputs": {
"bundledDefaultEnabled": false,
"paths": [
{ "path": "accounts.*.password", "expected": "string", "ownerKind": "route" }
]
},
"dangerousFlags": [
{ "path": "accounts.*.senderAuth.acceptTrustedAuthservId", "equals": true },
{ "path": "accounts.*.senderAuth.min", "equals": "unverified" },
{ "path": "accounts.*.senderAuth.min", "equals": "mutable" }
]
},
"uiHints": {
"accounts.*.password": { "label": "IMAP password", "sensitive": true },
"accounts.*.allowedSenders": {
"label": "Allowed senders",
"help": "Email addresses or @domain entries permitted to trigger the reader agent."
},
"accounts.*.agentId": { "label": "Restricted reader agent" },
"accounts.*.senderAuth.min": { "label": "Minimum sender authentication", "advanced": true }
},
"configSchema": {
"type": "object",
"additionalProperties": false,
"$defs": {
"secretRef": {
"type": "object",
"additionalProperties": false,
"properties": {
"source": { "type": "string", "enum": ["env", "file", "exec", "store"] },
"provider": { "type": "string" },
"id": { "type": "string" }
},
"required": ["source", "provider", "id"]
},
"secretInput": {
"anyOf": [{ "type": "string", "minLength": 1 }, { "$ref": "#/$defs/secretRef" }]
},
"senderAuth": {
"type": "object",
"additionalProperties": false,
"properties": {
"min": { "type": "string", "enum": ["verified", "asserted", "unverified", "mutable"], "default": "verified" },
"trustedAuthservIds": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"acceptTrustedAuthservId": { "type": "boolean", "default": false }
}
},
"addressToken": {
"type": "object",
"additionalProperties": false,
"properties": {
"token": { "type": "string", "minLength": 1 },
"senders": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1 }
},
"required": ["token", "senders"]
},
"watch": {
"type": "object",
"additionalProperties": false,
"properties": {
"mode": { "type": "string", "enum": ["auto", "idle", "interval"], "default": "auto" },
"pollSeconds": { "type": "integer", "minimum": 15, "default": 60 }
}
},
"account": {
"type": "object",
"additionalProperties": false,
"properties": {
"host": { "type": "string", "minLength": 1 },
"port": { "type": "integer", "minimum": 1, "maximum": 65535, "default": 993 },
"secure": { "type": "boolean", "default": true },
"user": { "type": "string", "minLength": 1 },
"password": { "$ref": "#/$defs/secretInput" },
"mailbox": { "type": "string", "minLength": 1, "default": "INBOX" },
"watch": { "$ref": "#/$defs/watch" },
"allowedSenders": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"senderAuth": { "$ref": "#/$defs/senderAuth" },
"addressTokens": { "type": "array", "items": { "$ref": "#/$defs/addressToken" } },
"agentId": { "type": "string", "minLength": 1 },
"deliver": { "type": "boolean", "default": false },
"includeBody": { "type": "boolean", "default": true },
"maxBytes": { "type": "integer", "minimum": 256, "maximum": 1048576, "default": 20000 },
"model": { "type": "string", "minLength": 1 },
"thinking": { "type": "string", "enum": ["off", "minimal", "low", "medium", "high", "xhigh", "adaptive", "max", "ultra"] },
"timeoutSeconds": { "type": "integer", "minimum": 1 }
},
"required": ["host", "user", "password", "agentId"]
}
},
"properties": {
"accounts": {
"type": "object",
"propertyNames": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*$" },
"additionalProperties": { "$ref": "#/$defs/account" }
}
}
}
}