{"record":{"id":"881b9b244fa38d71","repo":"pentaho/pentaho-kettle","slug":"mail-log-authenticationuserfieldempty","errorCode":null,"errorMessage":"Mail.Log.AuthenticationUserFieldEmpty","messagePattern":"Mail\\.Log\\.AuthenticationUserFieldEmpty","errorType":"validation","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java","lineNumber":492,"sourceCode":"    }\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() ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.AuthenticationUserFieldEmpty\" ) );\n      }\n\n      // check authentication pass\n      if ( Utils.isEmpty( meta.getAuthenticationPassword() ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.AuthenticationPasswordFieldEmpty\" ) );\n      }\n    }\n  }\n\n  @VisibleForTesting\n  void validateZipFiles( MailMeta meta ) throws KettleException {\n    if ( meta.isZipFiles() && ( Utils.isEmpty( meta.getZipFilename() ) && !meta.isZipFilenameDynamic() ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.ZipFilenameEmpty\" ) );\n    }\n  }\n\n  @VisibleForTesting\n  void processAttachedFiles() throws KettleException {","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java#L474-L510","documentation":"Thrown by Mail.validateMetaFields when SMTP authentication is set to basic (AUTENTICATION_BASIC) but meta.getAuthenticationUser() is empty. The Mail step requires a username whenever basic SMTP auth is enabled, so it aborts before sending. Password absence is checked next as a separate error (3196).","triggerScenarios":"Enabling 'Use authentication' with the basic option in the Mail step and leaving the Authentication User field blank; code-built MailMeta setting authentication to basic without setAuthenticationUser(...); the username being supplied via a variable that resolves to empty.","commonSituations":"Shared transformations where credentials were stripped for security; users selecting basic auth intending OAuth/other and not filling user fields; environment variables for SMTP user not defined on the execution server.","solutions":["Enter the SMTP username in the Mail step's Authentication User field.","Call meta.setAuthenticationUser(\"smtpUser\") in code when using basic authentication.","If authentication is not required, change the authentication option to 'none' instead of leaving the user blank.","If the user comes from a ${variable}, confirm the variable is defined in kettle.properties or the launch environment."],"exampleFix":"// before\nmeta.setUsingAuthentication(MailMeta.AUTENTICATION_BASIC);\n// after\nmeta.setUsingAuthentication(MailMeta.AUTENTICATION_BASIC);\nmeta.setAuthenticationUser(\"smtpUser\");\nmeta.setAuthenticationPassword(\"smtpPass\");","handlingStrategy":"validation","validationCode":"if ( MailMeta.AUTENTICATION_BASIC.equals( meta.isUsingAuthentication() )\n     && ( meta.getAuthenticationUser() == null || meta.getAuthenticationUser().trim().isEmpty() ) ) {\n  throw new IllegalArgumentException(\"Mail step: authentication user required for basic auth\");\n}","typeGuard":null,"tryCatchPattern":"try { transformation.execute(); } catch ( KettleException e ) { if ( e.getMessage().contains(\"AuthenticationUserFieldEmpty\") ) { /* supply credentials or disable auth */ } else { throw e; } }","preventionTips":["Fill user and password together when enabling basic SMTP auth","Inject credentials from environment variables, never blank placeholders","Verify variables exist on all execution nodes"],"tags":["kettle","mail-step","smtp","authentication","validation"],"backgroundTag":"missing-credentials","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"}