1

There is Dovecot service on the server. I had moved messages in user mailbox manually from one to another. Now I am experiencing some sorting problem on iOS device. For example:

  • I have mail 2 days old. (Message A)
  • I moved older mail to same directory (via ssh)
  • Thunderbird and Roundcube works fine.

But on my iPhone I had to configure mail account again. Unfortunately, the messages were in wrong order after sync. Now I must scroll down for ages to get the Message A.

I found, that iOS mail client doesn't support sorting of messages. Is any possibility to re-sort every message via it's date header, or force Dovecot to return messages in required order?

Telnet returns:

OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED AUTH=CRAM-MD5] Dovecot (Ubuntu) ready.

after login:

4 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE BINARY MOVE] Logged in

I had found, that Dovecot SORT extension works out of box. Is there any method to force sorting by date?

Tomasz
  • 371
  • 3
  • 7

1 Answers1

1

Dovecot has an index inside maildir where all the messages, delivered via imap are indexed. Manually moved messages are not included into the index and thus they are out of order.

All you have to do - is to reindex maildir manually with doveadm utility:

doveadm index -u username Inbox

Further reading can be found here: http://wiki2.dovecot.org/Tools/Doveadm/Index

Kondybas
  • 6,964
  • 2
  • 20
  • 24
  • i tried it again, result was: `Info: INBOX: Cache is already up to date` but when I read inbox directory using method without sorting (raw read with PHP), the messages are unordered – Tomasz Jun 03 '14 at 20:58