{"record":{"id":"a2120daabbce1a05","repo":"pentaho/pentaho-kettle","slug":"mail-exception-couldnotfindreplytoaddressesfield","errorCode":null,"errorMessage":"Mail.Exception.CouldnotFindReplyToAddressesField","messagePattern":"Mail\\.Exception\\.CouldnotFindReplyToAddressesField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java","lineNumber":309,"sourceCode":"    // Sender address\n    // cache the position of the sender field\n    if ( data.indexOfSenderAddress < 0 ) {\n      String realSenderAddress = meta.getReplyAddress();\n      data.indexOfSenderAddress = data.previousRowMeta.indexOfValue( realSenderAddress );\n      if ( data.indexOfSenderAddress < 0 ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"Mail.Exception.CouldnotFindReplyAddressField\", realSenderAddress ) );\n      }\n    }\n\n    // Reply to\n    if ( !Utils.isEmpty( meta.getReplyToAddresses() ) ) {\n      // cache the position of the reply to field\n      if ( data.indexOfReplyToAddresses < 0 ) {\n        String realReplyToAddresses = meta.getReplyToAddresses();\n        data.indexOfReplyToAddresses = data.previousRowMeta.indexOfValue( realReplyToAddresses );\n        if ( data.indexOfReplyToAddresses < 0 ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"Mail.Exception.CouldnotFindReplyToAddressesField\", realReplyToAddresses ) );\n        }\n      }\n    }\n\n    // Contact Person\n    if ( !Utils.isEmpty( meta.getContactPerson() ) ) {\n      // cache the position of the destination field\n      if ( data.indexOfContactPerson < 0 ) {\n        String realContactPerson = meta.getContactPerson();\n        data.indexOfContactPerson = data.previousRowMeta.indexOfValue( realContactPerson );\n        if ( data.indexOfContactPerson < 0 ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"Mail.Exception.CouldnotFindContactPersonField\", realContactPerson ) );\n        }\n      }\n    }\n    // Contact Phone","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java#L291-L327","documentation":"Thrown by cacheFieldsPosition when the Reply-To addresses field configured in Mail meta cannot be found in the incoming row's RowMeta. Checked only when the reply-to field is configured; indexOfValue returning -1 throws the KettleException.","triggerScenarios":"meta.getReplyToAddresses() is non-empty and data.indexOfReplyToAddresses == -1 after indexOfValue on previousRowMeta.","commonSituations":"Reply-To column renamed upstream; optional reply-to column absent on some input paths; stale step configuration after transformation refactor.","solutions":["Correct the 'Reply To (from field)' setting to match an existing column","Ensure the upstream step always emits the reply-to column","Clear the reply-to field setting if not needed"],"exampleFix":"// before\nmeta.setReplyToAddresses(\"replyto\");\n// after\nmeta.setReplyToAddresses(\"reply_to_addresses\");","handlingStrategy":"validation","validationCode":"// ensure the reply-to field exists when configured\nif (!isEmpty(meta.getReplyToAddresses()) && rowMeta.indexOfValue(meta.getReplyToAddresses()) < 0) {\n  logError(\"Reply-To field not in stream: \" + meta.getReplyToAddresses());\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"CouldnotFindReplyToAddressesField\")) {\n    logError(\"Reply-To field missing: \" + e.getMessage());\n  }\n}","preventionTips":["Configure Reply-To only when the column is present for all rows","Use Add constants to inject a default reply-to column if needed","Preview the stream before running in production"],"tags":["kettle","mail","field-lookup","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}