jimjag / telaen

Telaen is a webmail interface written in PHP. It does not require any database and is compatible with POP3 or IMAP so it runs under any Server supporting PHP with Sendmail or QMAIL. Additional skins and languages can be easily integrated.
GNU General Public License v2.0
22 stars 11 forks source link

Parsing of non INBOX folders #2

Closed conceptlane closed 9 years ago

conceptlane commented 11 years ago

Hi,

After deploying 1.3.1, paged navigation in non INBOX folders is now broken. Accessing pages other than 1 resulted in "endless redirection" which would never complete.

Found that the issue is in sequencing:

a. When messages.php identifies a message that is not yet "hparsed", it forces a refresh b. process.php reloads the folder, and identifies message 20 to 40 for parsing only c. sorting is performed AFTER step b d. Returns to messages.php which then finds that some messages in the selected page aren't hparsed yet, thus returns to step b again.

Had to insert: $start=0; $end_pos=$start+$mcount; at line 815 of class.telaen_mail.php, in order to make the webmail work at the cost of some initial sluggishness. Would be extremely bad for huge folders, but this is the default behaviour in 1.2.1 anyway.

Roy

jimjag commented 11 years ago

Thanks. Let me review and have a fix for 1.3.2.

conceptlane commented 11 years ago

If I may suggest, one possible way would be to put sorting into mail_list_msgs as an additional parameter which is then supplied into the pop and imap functions. Sorting would then be performed before the for loop (shortly after line 815).

jimjag commented 11 years ago

OK, I'm having a hard time recreating this... It certainly doesn't happen with the SENT folder, at least on my setup, regardless of sorting.

conceptlane commented 11 years ago

Unfortunately, I'm unable to provide you with a test account with a copy of the messages stored since they are client-confidential. But I believe you understand where the looping is occurring for me right?