Repository navigation
Description
Problem
imap-smtp is the only shipped connector that talks to two independently
authenticated services — an IMAP server and an SMTP server. Its contract
assumes they are one:
# configs/platform/system/connectors/imap-smtp/connector.yml
configFields:
- key: imapHost required: true
- key: imapPort default: 993
- key: smtpHost required: true
- key: smtpPort default: 587
- key: security enum: [tls, starttls] # "Transport security for both servers."
- key: sentMailbox
auth:
- method: basic # one username + passwordOne basic credential and one security value cannot describe a mailbox read
over IMAPS while mail is sent through a separate transactional provider — a
mainstream self-hosted setup:
| host | port | transport | login | |
|---|---|---|---|---|
| IMAP | private mailbox | 993 | TLS | mailbox user + password |
| SMTP | a transactional email provider | 587 | STARTTLS | provider user + API key |
security: tls breaks the SMTP leg; starttls breaks the IMAP leg. There is
also no fromAddress, which such a setup needs.
This worked before the AI-backend rewrite: the retired integrationCredentials
row carried separate basicAuth and smtpAuth blocks plus a
connectionConfig with independent imapSecure / smtpSecure.
Current behaviour
Multi-credential is already supported and is not the gap — the schema calls
cardinality "the headline fix", and resolveConnectorCredential takes a
credentialRef ("a credential id or its human name; omitted means the
organization's default").
What is missing is selection from a workflow. credentialRef is threaded
through lib/connectors/dispatcher.ts, lib/chat/capabilities.ts,
convex/connectors/hostcall_token.ts and executeConnectorAction, but the
engine's node document has no credential key — lib/engine/core/validate/nodes.ts
and lib/engine/core/types.ts never mention one. A connector node carries only
type and input:
# configs/platform/custom/automations/imap-smtp/triage-inbox/workflow.yml
- id: fetch
type: imap-smtp.list_messages
input: { limit: '…', mailbox: INBOX }So chat can name a credential and an automation cannot — every node resolves the
org default. Two credentials can exist; a workflow cannot choose between them.
Why no other connector hits this
All 16 shipped connectors declare exactly one auth method, and every other one
addresses a single service:
github,discord— one API, one bearerconfluence,shopify—endpointMode: per-credential, i.e. different
instances of the same service, still one credential per invocationgmail,outlook,slack,teams— one OAuth grant covering read and write
auth being an array means multi-method is declarable, but nothing exercises it.
So this is not an oversight in one connector — the model has no shape for
"one connector, two services", and imap-smtp is the first case to need one.
Proposed change
Three options, ascending in blast radius. Filing as needs discussion because
the choice is a product/architecture call, not a mechanical fix.
- Per-node credential selection. Add an optional
credential:to connector
nodes, threaded to thecredentialRefthat already exists end to end.
Smallest change and useful on its own (it also lets an automation address a
specific instance of a per-credential connector). Insufficient alone here:
securityand the host config still come from one credential'sconfig. - Split the transport config —
imapSecurity/smtpSecurityinstead of one
security, and addfromAddress. Config-only, touches no credential model.
Needed regardless of 1 or 3. - Per-action auth. Let a connector declare which auth entry an action uses,
solist_messagesandsendresolve different credentials. The general fix,
and the most invasive.
1 + 2 appears to be the smallest combination that supports the table above.
Acceptance criteria
- A mailbox read over IMAPS on 993 and sent through a separate provider over
STARTTLS on 587, with different logins, can be configured through the UI. - The inbound sync and the outbound send each resolve their own credential.
fromAddressis expressible.- An automation can name which credential a connector node uses, or the chosen
alternative is documented. - Existing single-service connectors keep working with one credential and no
config change.
Activity
Israeltheminer commentedon Aug 6, 2026
Resolved. Option 1 (per-node credential selection) was not taken — the second branch of the last acceptance criterion was: one automation covers every connection, and the behaviour is documented.
How each criterion is met
A mailbox read over IMAPS on 993 and sent through a separate provider over STARTTLS on 587, with different logins, configurable through the UI.
#2892 added the optional separate SMTP login (
smtpUsername/smtpPassword) alongside the mailbox login, wired through auth injection, the native transport, and a toggle on the credential form. #2896 made well-known ports own the TLS mode — 993/465 implicit, 143/587 STARTTLS — so the sharedsecurityselect can no longer pairtlswith 587 and produce OpenSSL'swrong version number.securitysurvives only as the fallback for a non-standard port.The inbound sync and the outbound send each resolve their own credential.
mailboxConfigFromCredentialbuilds separateimapandsmtpauth blocks from one row: the SMTP leg uses the relay login when one is stored and the mailbox login otherwise. A half-entered relay login is refused rather than silently mixed with the mailbox pair.fromAddressis expressible.#2924 declared it as a config field and mirrors it from the IMAP login on write, healing rows written before the mirror existed on the next sync pass. It is server-owned rather than a second input, because From and the mailbox login are one answer.
An automation can name which credential a connector node uses, or the chosen alternative is documented.
The alternative. #2915 gave each mail credential its own sync watermark; #2916 made
conversation.sync_mailboxand the newconversation.list_mailbox_messageswalk every active credential on the connector, each from its own watermark, with a failing mailbox isolated and reported ininbound.reasoninstead of aborting the pass. One automation therefore covers every connected mailbox and no node needs to name one. Documented in en / de / fr underplatform/admin/connectors,platform/automations/builtinanddevelop/connectors.Existing single-service connectors keep working with one credential and no config change.
Unchanged — resolution still falls back to the connector's default credential everywhere else.
On the proposed options
Option 2 landed by a different route than proposed: rather than splitting
securityintoimapSecurity/smtpSecurity, the port decides the transport. That also repairs credentials already saved with a mismatched pair, without a migration.Option 3 (per-action auth) stayed unbuilt and is not needed for this shape: one credential row carries both logins, so
list_messagesandsendalready authenticate as different identities against different servers.Not part of this issue, but noticed while confirming it
lib/connectors/registry.tsstill listscredentialin a connector node'sallowedFields, whileNodeDefhas no such field and the stepper passes nocredentialRef. The node inspector reads allowed fields generically, so a Credential box renders on connector nodes, persists whatever is typed into the document, and the run ignores it.develop/connectors.mdalso describes pointing an automation at a different credential name as a supported seam. Either the field goes or it gets wired — neither affects the mailbox case above.