I was making a script that would just read out the mail headers, but it takes a long time to get them, even for just a couple of emails. Is there something I'm missing with imap_headers()?
Try it with another mail server -- maybe it is your particular mail server that is slowing down the process, or maybe the connection between your script and your mail server...
Diego