Ok - which is it - they are all seperate messages in seperate files or they are all stored in one file? I can't answer that question - you have to. The code that I provided was based off 1 message per 1 file. You are going to want to use different code and a different module if it is a regular *nix mbox file. Which is frustrating since you told me all my original assumptions were correct. It sounds to me like you are putting the cart before the horse since it doesn't appear you have a good handle on the piece that gets the mail to the folder in the first place.