Roundcube Community Forum

 

Sort by Date doesn't work if mails have been moved

Started by ted_simple, November 27, 2007, 12:29:10 PM

Previous topic - Next topic

ted_simple

Hallo,

I suppose you're aware of this: The sort by date means that mails are sorted in the order in which they arrived in the particular IMAP folder, and not by the actual Send or Received date of the mail.

This renders Roundcube useless for me, because I'm planning to move all my mails to another server, which will mix up the entire date/time order. The correct dates are shown, and it becomes obvious at once that something is wrong:

Sender1  Subject1  Nov 15
Sender2  Subject2  Nov 20
Sender3  Subject3  Nov 11

and so on.

ted_simple

Actually, if I set up another sort order

// default sort col
$rcmail_config['message_sort_col'] = 'size';

it doesn't work either. No order is applied. The date column is colored dark grey though.


EDIT: Have decided to move on to another webmail script. But maybe my hints are still useful to you.

bagu

#2
This "bug" is still here...

Is there any way to correct this ?
Because moving mail destroy date sort, it's hard to manage folders in imap...

ABerglund

In version 0.3 and later, go to Preferences -> User Interface and uncheck the box for "Use message index for sorting by date".
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA

bagu

I must hide myself under the carpet...

Thanks a lot.

Trizzunkz

#5
Quote from: ABerglund;25091In version 0.3 and later, go to Preferences -> User Interface and uncheck the box for "Use message index for sorting by date".

I've just discovered this "bug" myself after moving all my mail to our new server. Is there anyway I can set this option off by default, so I don't have to go to all the users and do it manually?

EDIT:
Nevermind. I found it in main.inc.php

ABerglund

In addition to setting it to 'off' by default, you can also set it so the user can't see or change it later by adding it to the 'dont_override' array.

$rcmail_config['dont_override'] = array('index_sort','trash_mbox','sent_mbox','junk_mbox','drafts_mbox');
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA

Trizzunkz


dahepe

Hi,

is there any way to fix the message index for imported mails?

Best regards

Martian

Quote from: dahepe;26488Hi,

is there any way to fix the message index for imported mails?

Best regards

This depends on how you import the messages, what you are importing from / to.

For example I am switching from Cyrus Imap to Dovecot using Cyrus2Dovecot ( Cyrus2Dovecot - Home ) and it keeps all the metadata in tact so I don't have to worry about this issue.

Martian

dahepe

#10
Is the mail index an issue of the IMAP server or is it maintained by RoundCube?

My "import" was a simple drag and drop from an old Thunderbird POP3 account to a Courier IMAP server.

The German translation mentions that using the mail index for sorting by date performs better than actually sorting by date. If the mail index is a feature of the IMAP server, I would imagine sorting by the date column of the messages table should perform better than relying on a server functionality.

Best regards

Martian

When you copy a mail from one IMAP server to another you effectively create a new file on the new IMAP server with the date of the time it was moved.  In other words the new IMAP server sees the message as being "received" when it is copied over NOT when you origianlly recieved it on the old IMAP server.

The only way that I know of to avoid this is to use some sort of script to convert your mail from one format to the other and then copy it over.

Martian

dziobak

you can try use tar which should not change file attributes and creation/modification dates

Trizzunkz

Sorting by index would techically perform better than sorting by date, but on my system, the difference isn't noticable. Just turn it off, and the problem is gone.

dahepe

Hi,

@Martian & @dziobak
Actually the creation date of the message files on the server is correct. That is an imported message that was received on the 13th of January 2009 19:40:56 has as creation timestamp 2009-01-14 19:40:56.00000000. The ctime (time of last modification of the file info) however matches the time of the import. But strangely sorting by ctime on the filesystem doesn't sort the messages in the same order as RoundCube does, when sorting by index.

@Trizzunkz
It think it depends: If the mail index is a feature of the IMAP server, then sorting by the date column of the RoundCube messages database table, should perform better, at least from my feeling. If the index is of course maintained by RoundCube and based on the RoundCube database, then sorting by this index should/will perform better, but than it should be possible to fix this index by a relatively simple SQL-statement.

Regards

P.S.: Of course switching of the "Sort messages by index, when sorting by date" option solves the issue. I'm just wondering what this mysterious index is based on...