Internal Date fixes for Outlook/other displaying wrong message date
Kevin Baker
kevbaker at yahoo.com
Fri Nov 18 00:15:03 CET 2005
So I have had this problem a bunch of times in various
migrations.
I finally sat down and wrote a fix for it. Here's an
overview of my adventure with restoring mailboxes from a
backup with bad message file timestamps and perms.
Basically if you have to restore a kolab/cyrus mailbox with
message files that do not have the correct time stamp on
the file, matching the internal date of the message, AND
you do not have accurate cyrus.* meta files with you
messages you will likely have date issues when using
reconstruct.
Reconstruct will try to take the date from the file
timestamp rather than the internal date if the cyrus meta
files (header,index,cache) are not correct. Since in this
case the stamp is wrong the dates will be wrong in the
reconstruct.
For me these incorrect dates only seem to show up in
Outlook, but since my clients use Outlook this is a
problem. Other clients look inside the message and get the
actual internal date, so if you were using say Thunderbird
you wouldn't notice the issue.
THE FIX:
I wrote a CLI PHP script that recursively reads through the
mailbox folders, open messages grabs internal dates, and
timestamps the file files.
After running this I need to remove some of the cyrus meta
files. So I leave cyrus.header. That is needed for
reconstruct with "-f" to find a folder for a mailbox it is
restoring from scratch. I delete the cyrus.index and
cyrus.cache. For me these files were not accurate after my
migration so I was better off deleting them before
reconstruct. Reconstuct can "reconstruct" the files based o
the actual message files. I wrote another CLI PHP script
for this.
Now I need to run reconstruct: I use the "-f" flag to find
folders that have "cyrus.header" files. I also use "-x" to
use only the files contents to rebuild the cyrus index and
cache. And lastly I use "-r" to recurse through the
mailbox.
/kolab/bin/cyrreconstruct -rfx user/{MAILBOX}@{MYDOMAIN}
So that's that... I have had to migrate 120GB of mail over
the past month from a custom cyrus/postfix/ldap config to a
Kolab2 config. I think I ran into every possible problem. I
still have a few to get through, but wanted to share my
learnings.
I am going to update the Kolab wiki with this stuff.
Lastly, If you are doing backups, be sure to --preserve all
perms and ownership. This will keep you from having to do
the above internaldate fix or deal with any incorrect perms
that can hose the Kolab cyrreconstruct.
cp -pirv * /backup/
Hope this helps someone in the future....
Kevin Baker
Mission Vi Inc.
Kevin Baker
Mission Vi Inc.
kbaker at missionvi.com
858.454.5532
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
More information about the users
mailing list