{"record":{"id":"d640ecac7f7d0b8e","repo":"pentaho/pentaho-kettle","slug":"mail-log-serverfieldempty","errorCode":null,"errorMessage":"Mail.Log.ServerFieldEmpty","messagePattern":"Mail\\.Log\\.ServerFieldEmpty","errorType":"validation","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java","lineNumber":473,"sourceCode":"      processAttachedFiles();\n    }\n  }\n\n  @VisibleForTesting\n  void validateMetaFields( MailMeta meta ) throws KettleException {\n    // Check is filename field is provided\n    if ( Utils.isEmpty( meta.getDestination() ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.DestinationFieldEmpty\" ) );\n    }\n\n    // Check is replyname field is provided\n    if ( Utils.isEmpty( meta.getReplyAddress() ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.ReplyFieldEmpty\" ) );\n    }\n\n    // Check is SMTP server is provided\n    if ( Utils.isEmpty( meta.getServer() ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.ServerFieldEmpty\" ) );\n    }\n\n    // Check Attached filenames when dynamic\n    if ( meta.isDynamicFilename() && Utils.isEmpty( meta.getDynamicFieldname() ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.DynamicFilenameFieldEmpty\" ) );\n    }\n\n    // Check Attached zipfilename when dynamic\n    if ( meta.isZipFilenameDynamic() && Utils.isEmpty( meta.getDynamicZipFilenameField() ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.DynamicZipFilenameFieldEmpty\" ) );\n    }\n\n    validateZipFiles( meta );\n\n    // check authentication\n    if ( meta.isUsingAuthentication().equals( AUTENTICATION_BASIC ) ) {\n      // check authentication user\n      if ( Utils.isEmpty( meta.getAuthenticationUser() ) ) {","sourceCodeStart":455,"sourceCodeEnd":491,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java#L455-L491","documentation":"Thrown by Mail.validateMetaFields when meta.getServer() is empty, i.e. no SMTP server host was configured. Without an SMTP host the step cannot send mail at all, so it aborts during processRow before any rows are handled. This is a required-configuration check, not a connectivity error.","triggerScenarios":"Running the Mail step with the SMTP server field blank in the step dialog; MailMeta constructed in code without setServer(); server value referencing an environment-specific setting that was lost on import.","commonSituations":"Moving transformations between dev/prod where the SMTP host was hardcoded and removed; new users not realizing the server field is mandatory; KETTLE variable used for the server not defined so it resolves to empty.","solutions":["Set the SMTP server host in the Mail step dialog (e.g. smtp.yourdomain.com).","Call meta.setServer(\"smtp.yourdomain.com\") when building MailMeta in code.","If you use a ${SMTP_SERVER} variable, confirm it is defined in kettle.properties or at launch, otherwise it resolves empty."],"exampleFix":"// before\nmeta.setDestination(\"destField\");\nmeta.setReplyAddress(\"reply@corp.com\");\n// after\nmeta.setDestination(\"destField\");\nmeta.setReplyAddress(\"reply@corp.com\");\nmeta.setServer(\"smtp.corp.com\");","handlingStrategy":"validation","validationCode":"if ( meta.getServer() == null || meta.getServer().trim().isEmpty() ) {\n  throw new IllegalArgumentException(\"Mail step: SMTP server is required\");\n}","typeGuard":null,"tryCatchPattern":"try { transformation.execute(); } catch ( KettleException e ) { if ( e.getMessage().contains(\"ServerFieldEmpty\") ) { /* define ${SMTP_SERVER} or set meta.setServer(...) */ } else { throw e; } }","preventionTips":["Define SMTP server via an environment-specific variable and verify it resolves before runs","Never leave the server field blank when sharing transformations between environments","Smoke-test Mail steps in CI with a stub SMTP host"],"tags":["kettle","mail-step","smtp","configuration"],"backgroundTag":"missing-required-config-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"}