{"record":{"id":"7a91e025c5664395","repo":"pentaho/pentaho-kettle","slug":"mailvalidator-error-defaultsmtpfieldmissing","errorCode":null,"errorMessage":"MailValidator.Error.DefaultSMTPFieldMissing","messagePattern":"MailValidator\\.Error\\.DefaultSMTPFieldMissing","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail-validator/impl/src/main/java/org/pentaho/di/trans/steps/mailvalidator/MailValidator.java","lineNumber":110,"sourceCode":"      }\n\n      data.realResultErrorsFieldName = environmentSubstitute( meta.getErrorsField() );\n\n      // cache the position of the field\n      if ( data.indexOfeMailField < 0 ) {\n        data.indexOfeMailField = data.previousRowMeta.indexOfValue( meta.getEmailField() );\n        if ( data.indexOfeMailField < 0 ) {\n          // The field is unreachable !\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"MailValidator.Exception.CouldnotFindField\", meta.getEmailField() ) );\n        }\n      }\n\n      // SMTP check?\n      if ( meta.isSMTPCheck() ) {\n        if ( meta.isdynamicDefaultSMTP() ) {\n          if ( Utils.isEmpty( meta.getDefaultSMTP() ) ) {\n            throw new KettleException( BaseMessages.getString( PKG, \"MailValidator.Error.DefaultSMTPFieldMissing\" ) );\n          }\n\n          if ( data.indexOfdefaultSMTPField < 0 ) {\n            data.indexOfdefaultSMTPField = data.previousRowMeta.indexOfValue( meta.getDefaultSMTP() );\n            if ( data.indexOfdefaultSMTPField < 0 ) {\n              // The field is unreachable !\n              throw new KettleException( BaseMessages.getString(\n                PKG, \"MailValidator.Exception.CouldnotFindField\", meta.getDefaultSMTP() ) );\n            }\n          }\n        }\n        // get Timeout\n        data.timeout = Const.toInt( environmentSubstitute( meta.getTimeOut() ), 0 );\n\n        // get email sender\n        data.realemailSender = environmentSubstitute( meta.geteMailSender() );\n\n        // get default SMTP server","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail-validator/impl/src/main/java/org/pentaho/di/trans/steps/mailvalidator/MailValidator.java#L92-L128","documentation":"MailValidator.processRow() throws this KettleException when dynamic default SMTP is enabled but the 'default SMTP server' setting is empty. In dynamic mode that setting names an input field supplying the SMTP server per row, so an empty value is invalid.","triggerScenarios":"Running with SMTP check enabled, 'dynamic default SMTP' checked, and the default SMTP field name left blank.","commonSituations":"Enabling dynamic default SMTP without filling the field selector; variable used for the field name resolves to empty at runtime.","solutions":["Open the step dialog and set the 'default SMTP server' field name used for dynamic lookup.","Uncheck 'dynamic default SMTP' if you want a static default SMTP server instead.","Ensure any variable in the setting is defined at runtime.","Verify the referenced field exists in the incoming stream (a follow-up check throws CouldnotFindField otherwise)."],"exampleFix":"// before\nmeta.setdynamicDefaultSMTP( true );\nmeta.setDefaultSMTP( \"\" );\n// after\nmeta.setdynamicDefaultSMTP( true );\nmeta.setDefaultSMTP( \"smtpServer\" );","handlingStrategy":"validation","validationCode":"if ( meta.isSMTPCheck() && meta.isdynamicDefaultSMTP()\n    && ( meta.getDefaultSMTP() == null || meta.getDefaultSMTP().isEmpty() ) ) {\n  throw new IllegalArgumentException(\n    \"Dynamic default SMTP requires a field name for the SMTP server\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute( null );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"DefaultSMTPFieldMissing\" ) ) {\n    logError( \"Set the default SMTP field name or disable dynamic default SMTP\" );\n  }\n  throw e;\n}","preventionTips":["Whenever enabling dynamic default SMTP, immediately select the field.","Prefer a static default SMTP server when all rows share one host.","Resolve any variables used in the setting before execution.","Document required fields for programmatic step configuration."],"tags":["configuration","smtp","email-validation","missing-field"],"backgroundTag":"empty-required-field","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"}