pentaho/pentaho-kettle · error · KettleException

MailValidator.Error.DefaultSMTPFieldMissing

Error message

MailValidator.Error.DefaultSMTPFieldMissing

What it means

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.

Solutions

  1. Open the step dialog and set the 'default SMTP server' field name used for dynamic lookup.
  2. Uncheck 'dynamic default SMTP' if you want a static default SMTP server instead.
  3. Ensure any variable in the setting is defined at runtime.
  4. Verify the referenced field exists in the incoming stream (a follow-up check throws CouldnotFindField otherwise).

Example fix

// before
meta.setdynamicDefaultSMTP( true );
meta.setDefaultSMTP( "" );
// after
meta.setdynamicDefaultSMTP( true );
meta.setDefaultSMTP( "smtpServer" );
Defensive patterns

Strategy: validation

Validate before calling

if ( meta.isSMTPCheck() && meta.isdynamicDefaultSMTP()
    && ( meta.getDefaultSMTP() == null || meta.getDefaultSMTP().isEmpty() ) ) {
  throw new IllegalArgumentException(
    "Dynamic default SMTP requires a field name for the SMTP server" );
}

Try / catch

try {
  trans.execute( null );
} catch ( KettleException e ) {
  if ( e.getMessage().contains( "DefaultSMTPFieldMissing" ) ) {
    logError( "Set the default SMTP field name or disable dynamic default SMTP" );
  }
  throw e;
}

Prevention

When it happens

Trigger: Running with SMTP check enabled, 'dynamic default SMTP' checked, and the default SMTP field name left blank.

Common situations: Enabling dynamic default SMTP without filling the field selector; variable used for the field name resolves to empty at runtime.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/7a91e025c5664395. Report an issue: GitHub.

Appendix: source

Thrown at plugins/mail-validator/impl/src/main/java/org/pentaho/di/trans/steps/mailvalidator/MailValidator.java:110

      }

      data.realResultErrorsFieldName = environmentSubstitute( meta.getErrorsField() );

      // cache the position of the field
      if ( data.indexOfeMailField < 0 ) {
        data.indexOfeMailField = data.previousRowMeta.indexOfValue( meta.getEmailField() );
        if ( data.indexOfeMailField < 0 ) {
          // The field is unreachable !
          throw new KettleException( BaseMessages.getString(
            PKG, "MailValidator.Exception.CouldnotFindField", meta.getEmailField() ) );
        }
      }

      // SMTP check?
      if ( meta.isSMTPCheck() ) {
        if ( meta.isdynamicDefaultSMTP() ) {
          if ( Utils.isEmpty( meta.getDefaultSMTP() ) ) {
            throw new KettleException( BaseMessages.getString( PKG, "MailValidator.Error.DefaultSMTPFieldMissing" ) );
          }

          if ( data.indexOfdefaultSMTPField < 0 ) {
            data.indexOfdefaultSMTPField = data.previousRowMeta.indexOfValue( meta.getDefaultSMTP() );
            if ( data.indexOfdefaultSMTPField < 0 ) {
              // The field is unreachable !
              throw new KettleException( BaseMessages.getString(
                PKG, "MailValidator.Exception.CouldnotFindField", meta.getDefaultSMTP() ) );
            }
          }
        }
        // get Timeout
        data.timeout = Const.toInt( environmentSubstitute( meta.getTimeOut() ), 0 );

        // get email sender
        data.realemailSender = environmentSubstitute( meta.geteMailSender() );

        // get default SMTP server

View on GitHub (pinned to f3058517a1)