Hi, I am using AKAN NKWEINI's DecodeMessage class for decoding MIME messages. It takes an email with headers and extracts the attachments. Instead of bothering Akan with questions, I thought I might bring this here. Problem is that it is very slow. It takes 40 seconds to process a 270k email consisting of 6 .jpg attachements. I know I am going to have to work with much larger emails than this and I can't wait this long to open them. I am running Linux/Apache/K6-2 400Mhz as the server.
I have done a little analyzing of the program and it seems that much time is spent just explode()ing strings into arrays of lines for processing line by line and other misc string ops. I am not sure how I can make this process faster. Is it unreasonable to suspect that explode()ing a 270k string will take a considerable amount of time? 30 seconds? It doesn't take long to actually run imap_base64() on the extracted parts.. it is just the actually extraction of the parts that is so slow. I may just have to overhaul the whole class to make it work directly with an array of lines rather than taking a string. Any suggestions? If you want to see the class, check out http://cowpatty.onshore.com/mimedecode.inc
thanks
-matthew