public Result execute( Result previousResult, int nr ) {
    Result result = previousResult;
    result.setNrErrors( 1 );
    result.setResult( false );

    String realEmailAddress = environmentSubstitute( emailAddress );
    if ( Utils.isEmpty( realEmailAddress ) ) {
      logError( BaseMessages.getString( PKG, "JobEntryMailValidator.Error.EmailEmpty" ) );
      return result;
    }
    String realSender = environmentSubstitute( emailSender );
    if ( smtpCheck ) {
      // check sender
      if ( Utils.isEmpty( realSender ) ) {
        logError( BaseMessages.getString( PKG, "JobEntryMailValidator.Error.EmailSenderEmpty" ) );
        return result;
      }
    }

    String realDefaultSMTP = environmentSubstitute( defaultSMTP );
    int timeOut = Const.toInt( environmentSubstitute( timeout ), 0 );

    // Split the mail-address: separated by space
    String[] mailsCheck = realEmailAddress.split( " " );
    boolean exitloop = false;
    boolean mailIsValid = false;
    String MailError = null;
    for ( int i = 0; i < mailsCheck.length && !exitloop; i++ ) {
      String email = mailsCheck[i];
      if ( log.isDetailed() ) {
        logDetailed( BaseMessages.getString( PKG, "JobEntryMailValidator.CheckingMail", email ) );
      }

      // Check if address is valid
      MailValidationResult resultValidator =
        MailValidation.isAddressValid( log, email, realSender, realDefaultSMTP, timeOut, smtpCheck );

      mailIsValid = resultValidator.isValide();
      MailError = resultValidator.getErrorMessage();

      if ( log.isDetailed() ) {
        if ( mailIsValid ) {
          logDetailed( BaseMessages.getString( PKG, "JobEntryMailValidator.MailValid", email ) );
        } else {
          logDetailed( BaseMessages.getString( PKG, "JobEntryMailValidator.MailNotValid", email ) );
          logDetailed( MailError );
        }

      }
      // invalid mail? exit loop
      if ( !resultValidator.isValide() ) {
        exitloop = true;
      }
    }

    result.setResult( mailIsValid );
    if ( mailIsValid ) {
      result.setNrErrors( 0 );
    }

    // return result

    return result;
  }
@Test
  public void testExecute() {
    KettleLogStore.init();
    Result previousResult = new Result();
    JobEntryMailValidator validator = new JobEntryMailValidator();
    Result result = validator.execute( previousResult, 0 );
    assertNotNull( result );
  }