{"record":{"id":"f8a1cccc858d09c5","repo":"pentaho/pentaho-kettle","slug":"mail-exception-couldnotfindreplynamefield","errorCode":null,"errorMessage":"Mail.Exception.CouldnotFindReplyNameField","messagePattern":"Mail\\.Exception\\.CouldnotFindReplyNameField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java","lineNumber":286,"sourceCode":"    if ( !Utils.isEmpty( meta.getDestinationBCc() ) ) {\n      // cache the position of the BCc field\n      if ( data.indexOfDestinationBCc < 0 ) {\n        String realDestinationBCcFieldname = meta.getDestinationBCc();\n        data.indexOfDestinationBCc = data.previousRowMeta.indexOfValue( realDestinationBCcFieldname );\n        if ( data.indexOfDestinationBCc < 0 ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"Mail.Exception.CouldnotFindDestinationBCcField\", realDestinationBCcFieldname ) );\n        }\n      }\n    }\n    // Sender Name\n    if ( !Utils.isEmpty( meta.getReplyName() ) ) {\n      // cache the position of the sender field\n      if ( data.indexOfSenderName < 0 ) {\n        String realSenderName = meta.getReplyName();\n        data.indexOfSenderName = data.previousRowMeta.indexOfValue( realSenderName );\n        if ( data.indexOfSenderName < 0 ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"Mail.Exception.CouldnotFindReplyNameField\", realSenderName ) );\n        }\n      }\n    }\n    // 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","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java#L268-L304","documentation":"Thrown by cacheFieldsPosition when the reply/sender NAME field configured in Mail meta is not found among incoming row fields. Only evaluated when a reply-name field is configured; indexOfValue returning -1 aborts the step.","triggerScenarios":"meta.getReplyName() is non-empty (field-based sender name) and data.indexOfSenderName == -1 after indexOfValue on previousRowMeta.","commonSituations":"Sender-name column renamed upstream; configured a literal name in the wrong (field-based) setting; input layout changed after configuration.","solutions":["Correct the 'Reply Name (from field)' setting to match an existing column","Use the static sender-name option instead of the field-based one if the name is constant","Ensure upstream emits the column for all rows"],"exampleFix":"// before\nmeta.setReplyName(\"sender_nm\");\n// after\nmeta.setReplyName(\"sender_name\");","handlingStrategy":"validation","validationCode":"// ensure the reply-name field exists when configured\nif (!isEmpty(meta.getReplyName()) && rowMeta.indexOfValue(meta.getReplyName()) < 0) {\n  logError(\"Reply name field not in stream: \" + meta.getReplyName());\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"CouldnotFindReplyNameField\")) {\n    logError(\"Reply name field missing: \" + e.getMessage());\n  }\n}","preventionTips":["Use the static sender-name option when the name does not vary per row","Select fields from the dropdown instead of typing","Confirm the stream layout after any upstream change"],"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"}