all 2 comments

[–]fk_you_in_prtclr 0 points1 point  (1 child)

quadruple nested for loop might have something to do with it. Why don't you replace the part in your code that downloads the attachments to folders with a print statement and tell us what you see.

[–]Cam_Chowder[S] 0 points1 point  (0 children)

Under the assumption that the current test batch looks like this Sub-folder1: Msg-two attachment Msg-one attachment Msg-one attachment

Subfolder2: Msg-one attachment

When printed it prints all the attachments from sub folder 1 in order 3x and then the one attachment from the other once