[Dovecot] UID order vs date order

LuKreme kremels at kreme.com
Sun Nov 17 20:27:58 EET 2013


On 17 Nov 2013, at 03:20 , Torbjorn Jansson <torbjorn.jansson at mbox200.swipnet.se> wrote:

> Hi
> 
> i have recently moved a mailbox to dovecot and intend to use it via imap and i have run into a problem.
> 
> when i imported the mails apparently the UID order got reversed compared to the date order, result is that some clients like on android devices download the oldest mails instead of newest.
> it is not so interesting to have several years old mail show up at the top of the mailbox.
> 
> is there any way of convincing dovecot to renumber the mails by date order instead?

Probably the easiest solution is to figure out what you did in the import to cause this and reimport the mails. Short of that, the only thing you can do (assuming you are using Maildir, right?) is to get the date out of the mail and rewrite the filename with the correct epoch timestamp.

It would be great if there was a way to use doveadm to do this, but short of that you just have to fix it yourself. The good news is, with gnu date it’s pretty simple.

 $ date --date='2013-11-17 01:23:45 +0700' +%s
1384626225
 $ gdate --date='November 17, 2013 01:23:45 +0700' +%s
1384626225
 $ gdate --date='17 Nov 2013 01:23:45 +0700' +%s
1384626225

> i cant be the only one that have run into this.

I had a similar problem, but I ignored it and as new mail came in, the problem went away (mostly) on its own. :/


-- 
A cubicle is simply a cell without a door.



More information about the dovecot mailing list