Budibase/budibase · error · Error

IMAP password is required

Error message

IMAP password is required

What it means

When the email trigger uses the default PASSWORD auth type, getAuthConfig requires inputs.password to construct IMAP credentials ({user, pass}). An empty or missing password throws this error before any IMAP connection is attempted.

Source

Thrown at packages/server/src/automations/email/utils/getClient.ts:91

  const authType = inputs.authType || EmailTriggerAuthType.PASSWORD

  if (authType === EmailTriggerAuthType.OAUTH2) {
    const oauth2Ids = resolveOAuth2Ids(inputs)
    if (!oauth2Ids) {
      throw new Error("OAuth2 connection is required")
    }
    const accessToken = await getOAuth2AccessToken(
      oauth2Ids.datasourceId,
      oauth2Ids.authConfigId
    )
    return {
      user: inputs.username,
      accessToken,
    }
  }

  if (!inputs.password) {
    throw new Error("IMAP password is required")
  }

  return {
    user: inputs.username,
    pass: inputs.password,
  }
}

export const getClient = async (inputs: EmailTriggerInputs) => {
  if (!inputs) {
    throw new Error("Email trigger inputs are required")
  }

  if (await blacklist.isBlacklisted(inputs.host)) {
    throw new Error("IMAP host is blocked or could not be resolved safely")
  }

  const client = new ImapFlow({

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Set the IMAP password in the email trigger configuration and re-save the automation
  2. If the password comes from a binding/env variable, confirm it resolves to a non-empty value at runtime
  3. If you meant to use OAuth2, set authType to OAUTH2 and provide an OAuth2 connection instead

Example fix

// before
{ "authType": "PASSWORD", "username": "user@example.com" } // password missing
// after
{ "authType": "PASSWORD", "username": "user@example.com", "password": "app-password" }
Defensive patterns

Strategy: validation

Validate before calling

if (inputs.authType !== EmailTriggerAuthType.OAUTH2 && !inputs.password) {
  throw new Error("Password auth selected but no password configured")
}

Type guard

function hasPassword(inputs: EmailTriggerInputs): inputs is EmailTriggerInputs & { password: string } {
  return typeof inputs.password === "string" && inputs.password.length > 0
}

Try / catch

try {
  const client = await getClient(inputs)
} catch (err) {
  if (err.message === "IMAP password is required") {
    // prompt user to configure credentials in the automation trigger
  }
  throw err
}

Prevention

When it happens

Trigger: authType is PASSWORD (or unset, defaulting to PASSWORD) and inputs.password is falsy (undefined, null, or empty string) when the automation runs.

Common situations: Creating the email trigger without filling in the password field; password stored in an env/bindings that resolves to empty at runtime; older automation definitions migrated without the password field; special characters stripped by config tooling.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/c202fbe5658b5356. Report an issue: GitHub.