pentaho/pentaho-kettle · error · KettleException

MailConnection.Error.MovingMessage

Error message

MailConnection.Error.MovingMessage

What it means

MailConnection.moveMessage() wraps any exception from the actual move (append to MBOX then delete, or IMAP copy/append plus flagging) into a KettleException with key MailConnection.Error.MovingMessage, the effective message number, and the destination (MBOX path or IMAP folder name). The original cause is attached.

Solutions

  1. Read the wrapped cause for the exact JavaMail error (quota, connection, folder state).
  2. Reconnect/reopen the destination folder and retry the move.
  3. Check IMAP quota (server-side) and free space on the MBOX filesystem.
  4. Ensure no other process holds a lock on the MBOX file.

Example fix

// before
connection.moveMessage(); // fails silently inside loop, no diagnostics
// after
try {
  connection.moveMessage();
} catch (KettleException e) {
  logError("Move of message failed to " + destination + ": " + e.getMessage(), e);
  connection.disconnect();
  connection.connect(); // retry after reopening
}
Defensive patterns

Strategy: try-catch

Validate before calling

// verify connectivity and quota before moving
if (!connection.isConnected()) { connection.connect(); }

Try / catch

try { connection.moveMessage(); } catch (KettleException e) { Throwable cause = e.getCause(); logError("Move failed for message to " + destination + ": " + cause, e); }

Prevention

When it happens

Trigger: Calling moveMessage() after setDestinationFolder() when appendMessagesToMbox(), deleteMessage(), or the IMAP appendMessages/copyMessages path throws — e.g. quota exceeded, destination folder closed, connection lost mid-move.

Common situations: IMAP server quota exceeded while appending; destination folder was closed or expunged; network drop between append and delete; MBOX file locked by another process.

Related errors


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

Appendix: source

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

        appendMessagesToMbox( new Message[] { this.message }, this.destinationMboxPath );
        updatedMovedMessagesCounter();
        deleteMessage();
        return;
      }

      // move all messages
      this.folder.copyMessages( new Message[] { this.message }, this.destinationIMAPFolder );
      updatedMovedMessagesCounter();
      // Make sure to delete messages
      deleteMessage();
    } catch ( Exception e ) {
      int messageNumber = getEffectiveMessageNumber( getMessage() );
      String errorMessage = ( this.protocol == MailConnectionMeta.PROTOCOL_MBOX )
        ? BaseMessages.getString( PKG, "MailConnection.Error.MovingMessage", ""
          + messageNumber, this.destinationMboxPath )
        : BaseMessages.getString( PKG, "MailConnection.Error.MovingMessage", ""
          + messageNumber, this.destinationIMAPFolder.getName() );
      throw new KettleException( errorMessage, e );
    }
  }

  /**
   * Returns the foldername.
   *
   * @return foldername
   */
  public String getFolderName() {
    if ( this.protocol == MailConnectionMeta.PROTOCOL_MBOX ) {
      return Const.NVL( this.mboxFolderName, "" );
    }

    if ( this.folder == null ) {
      return "";
    }
    return this.folder.getName();
  }

View on GitHub (pinned to f3058517a1)