mimedecode processes mail files using MIME::Parser module. It handles "multipart" messages and saves "attached" files (i.e. parts with suggested file names) to their suggested names in the directory specified after -d, or the current directory if -d is not given.