Adalennis opened a new issue, #9208:
URL: https://github.com/apache/hop/issues/9208

   ### Apache Hop version?
   
   SNAPSHOT-20261021
   
   ### Java version?
   
   Java 21
   
   ### Operating system
   
   macOS
   
   ### What happened?
   
   Found while documenting the result of this action (#8970, PR #9195). Tested 
with hop-run against GreenMail 2.1.3 (IMAP) and re-checked on today's main; the 
only change to the action since the tested build is in check() (#9085).
   
   **1. #IdFile# restarts in each folder, so messages of a subfolder overwrite 
files**
   
   The #IdFile# token of Target filename pattern is replaced with the loop 
index of the messages of the folder being read:
   
       String localfilenameMessage = replaceTokens(realFilenamePattern, i);   
// ActionGetPOP.java lines 906 and 1075
   
   fetchOneFolder() is called once per folder, so with Include subfolders the 
numbering starts again at 1 in every subfolder, and saveMessageContentToFile() 
overwrites an existing file. With 3 messages in INBOX and 1 in INBOX.sub and 
the pattern `msg_#IdFile#.mail`, the action saved 4 messages (Lines written = 
4) but only 3 files are left: `msg_1.mail` holds the subfolder message "In 
sub", and INBOX's "Invoice 1" is gone.
   
   Expected: a number that is unique over the whole run, so no message 
overwrites another.
   
   **2. Moving messages one at a time also counts them as deleted**
   
   MailConnection.moveMessage() copies the message, increases the moved 
counter, and then calls deleteMessage(), which increases the deleted counter 
too (lines 960-970). So a message moved with "Move message to folder" after 
retrieval, or with the action "Move messages to folder" and "Retrieve the 
first...emails", counts in both Lines updated and Lines deleted: 3 messages 
moved gave Lines updated = 3 and Lines deleted = 3. Moving all messages at once 
(moveMessages(), "Move messages to folder" without a limit) gives Lines updated 
= 3 and Lines deleted = 0.
   
   Expected: a moved message counts only as moved (Lines updated), as with the 
bulk move.
   
   The current behaviour is documented on the action page (PR #9195), so the 
docs need an update when these are fixed.
   
   ### Issue Priority
   
   Priority: 3
   
   ### Issue Component
   
   Component: Hop Gui


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to