{"record":{"id":"c202fbe5658b5356","repo":"Budibase/budibase","slug":"imap-password-is-required-c202fb","errorCode":null,"errorMessage":"IMAP password is required","messagePattern":"IMAP password is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/automations/email/utils/getClient.ts","lineNumber":91,"sourceCode":"  const authType = inputs.authType || EmailTriggerAuthType.PASSWORD\n\n  if (authType === EmailTriggerAuthType.OAUTH2) {\n    const oauth2Ids = resolveOAuth2Ids(inputs)\n    if (!oauth2Ids) {\n      throw new Error(\"OAuth2 connection is required\")\n    }\n    const accessToken = await getOAuth2AccessToken(\n      oauth2Ids.datasourceId,\n      oauth2Ids.authConfigId\n    )\n    return {\n      user: inputs.username,\n      accessToken,\n    }\n  }\n\n  if (!inputs.password) {\n    throw new Error(\"IMAP password is required\")\n  }\n\n  return {\n    user: inputs.username,\n    pass: inputs.password,\n  }\n}\n\nexport const getClient = async (inputs: EmailTriggerInputs) => {\n  if (!inputs) {\n    throw new Error(\"Email trigger inputs are required\")\n  }\n\n  if (await blacklist.isBlacklisted(inputs.host)) {\n    throw new Error(\"IMAP host is blocked or could not be resolved safely\")\n  }\n\n  const client = new ImapFlow({","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/automations/email/utils/getClient.ts#L73-L109","documentation":"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.","triggerScenarios":"authType is PASSWORD (or unset, defaulting to PASSWORD) and inputs.password is falsy (undefined, null, or empty string) when the automation runs.","commonSituations":"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.","solutions":["Set the IMAP password in the email trigger configuration and re-save the automation","If the password comes from a binding/env variable, confirm it resolves to a non-empty value at runtime","If you meant to use OAuth2, set authType to OAUTH2 and provide an OAuth2 connection instead"],"exampleFix":"// before\n{ \"authType\": \"PASSWORD\", \"username\": \"user@example.com\" } // password missing\n// after\n{ \"authType\": \"PASSWORD\", \"username\": \"user@example.com\", \"password\": \"app-password\" }","handlingStrategy":"validation","validationCode":"if (inputs.authType !== EmailTriggerAuthType.OAUTH2 && !inputs.password) {\n  throw new Error(\"Password auth selected but no password configured\")\n}","typeGuard":"function hasPassword(inputs: EmailTriggerInputs): inputs is EmailTriggerInputs & { password: string } {\n  return typeof inputs.password === \"string\" && inputs.password.length > 0\n}","tryCatchPattern":"try {\n  const client = await getClient(inputs)\n} catch (err) {\n  if (err.message === \"IMAP password is required\") {\n    // prompt user to configure credentials in the automation trigger\n  }\n  throw err\n}","preventionTips":["Fill both username and password when using password auth","Verify env/binding-backed secrets resolve to non-empty values","Prefer app passwords for Gmail/Outlook IMAP"],"tags":["imap","email","auth","missing-credential"],"backgroundTag":"missing-password-credential","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}