To be honest, there's no way anyone can answer this except from you. What parts are slow? Have you tried debugging, which will show you exactly where the slowdowns are? Put any timers in?
As you say, could be the mailserver. Could be the POP3 protocol. Could be the webserver.
I'd start by turning on debugging to see which tags are running slowly.
Thanks, I did what you said.
The result in time is in the image.
There is one of the mail, with 2 attached images of 15Mo (big, but can happen now with the actual cameras)
Then the CFPOP took 25seconds to get it (in "getonlyheaders").
If I use the "getall" it takes the same time.
The same retrieving with RoundCube, took less than 1 second.
With no big attachements, it is acceptable (but long to retrieve for example 50 mails)
I need to retrieve all at first round, because I want to reorder them by local date.
Then I display only 20 by 20.
It seems to me that the "gethearderonly" load the attchments. (I am in CF9).
<cfpop action="GETHEADERONLY" name="all_mails" server="#session.mail_server#" username="#session.UserName#" password="#session.pwd#">
Thanks for any suggestion.
To be honest I've seen people try what you're doing before, I even considered it myself once but ColdFusion is simply not the tool for the job. Most webmail interfaces are written in something extremely lightweight behind the scenes like Python or Perl, not an enormous stack of Java bloat.
The CFPOP tag is not a key part of CF, it's just one of many tags they've bolted on as a feature. It's slow, it's not tuned particularly well and it's not very flexible. I suspect you'll struggle to achieve what you're after here and should consider other options.
The POP3 protocol is for downloading mails to a client, and is not designed to be a two-way protocol for real-time display of data. You may have more luck with CFIMAP perhaps.
OK, thanks for your coment.