pentaho/pentaho-kettle · error · KettleException

JobGetMailsFromPOP.Error.OpeningDefaultFolder

Error message

JobGetMailsFromPOP.Error.OpeningDefaultFolder

What it means

MailConnection.openFolder() wraps exceptions from openFolderWithMode()/logFolderDetails() into a KettleException. When the folder is the default one the message is JobGetMailsFromPOP.Error.OpeningDefaultFolder; otherwise Error.OpeningFolder with the folder name. It means the store was connected but the folder could not be opened (READ_ONLY/READ_WRITE).

Solutions

  1. Check the exact folder name/path in the job entry (IMAP uses paths like INBOX.Subfolder).
  2. Ensure the folder isn't locked/in use and the account has rights to open it.
  3. Inspect the chained cause for the concrete MessagingException (folder not found vs access denied).
  4. For POP3, leave folder as INBOX — POP3 has no other folders.

Example fix

// before
openFolder("Inbos", false);
// after
openFolder("INBOX", true);
Defensive patterns

Strategy: try-catch

Validate before calling

// connect first, then verify folder presence
mailConnection.connect();
javax.mail.Folder f = mailConnection.getStore().getFolder("INBOX.Archive");
boolean ok = f != null && f.exists();

Try / catch

try {
  mailConnection.openFolder(folderName, isDefault);
} catch (KettleException e) {
  logError("Folder open failed for '" + folderName + "': " + e.getCause(), e);
  throw e;
}

Prevention

When it happens

Trigger: openFolder(...) delegates to openDefaultFolder/openSpecifiedFolder and the underlying folder.open(mode) throws MessagingException, or openDefaultFolder/openSpecifiedFolder themselves throw (invalid folder).

Common situations: Typo in IMAP folder path, folder locked by another client, POP3 store opened with a non-INBOX folder, mbox file unreadable, permissions denied on the mailbox.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at plugins/email-messages/impl/src/main/java/org/pentaho/di/job/entries/getpop/MailConnection.java:479

        openMboxFolder( foldername, defaultFolder );
        return;
      }

      if ( getFolder() != null ) {
        closeFolder( true );
      }

      if ( defaultFolder ) {
        openDefaultFolder();
      } else {
        openSpecifiedFolder( foldername );
      }

      openFolderWithMode();
      logFolderDetails();

    } catch ( Exception e ) {
      throw new KettleException( defaultFolder
        ? BaseMessages.getString( PKG, "JobGetMailsFromPOP.Error.OpeningDefaultFolder" )
        : BaseMessages.getString( PKG, "JobGetMailsFromPOP.Error.OpeningFolder", foldername ), e );
    }
  }

  private void openMboxFolder( String foldername, boolean defaultFolder ) {
    this.mboxFolderName = defaultFolder ? MailConnectionMeta.INBOX_FOLDER : Const.NVL( foldername, "" );
    this.folder = null;
    this.messages = null;
    this.message = null;
    this.messagenr = -1;
  }

  private void openDefaultFolder() throws KettleException, MessagingException {
    if ( protocol == MailConnectionMeta.PROTOCOL_MBOX ) {
      this.folder = this.store.getDefaultFolder();
    } else {
      this.folder = getRecursiveFolder( MailConnectionMeta.INBOX_FOLDER );

View on GitHub (pinned to f3058517a1)