Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Migration

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-08-2007, 05:37 AM
Intermediate Member
 
Posts: 22
Default Wrong dates in Zimbra Webmail

Hii,

today I noticed that my imported mails with imapsync from an existing courier imap server have the wrong received date.

I thought that --syncinternaldates didn't work but then I saw that zimbra stored the correct date on the right side of the sender's address.

Code:
Sent by: foo@bar.at On: <correct date>
Is there an option in zimbra to list the correct date in the received colum? Also the search option didn't work with the correct dates...

It seems that only the database has the wrong dates, all flatfiles have the correct date field in the mailheader.

I did a reindex of my mailbox but this didn't help, wrong date again... What else can I do?

Thanks!

Last edited by voltcraft; 03-08-2007 at 05:53 AM..
Reply With Quote
  #2 (permalink)  
Old 03-08-2007, 09:13 AM
Active Member
 
Posts: 43
Default

we have a very similar problem... we're synchronizing with outlook via Outlook Connector. the files were first imported in outlook from the *.zdb file and then synchronized... the dates are displayed wrong in zimbra web mail(only).

if we set up the account in thunderbird and access it via imap, the dates are correct, so i guess the problem is somewhere in zimbra or is this maybe a system thing??

the system clock is set up right i guess as it shows the correct time and is in UTC, date is also correct. are there any commands to fix this? is this somewhere in the database or what is this???

this is zimbra NE 4.5.3 on SUSE9.

Last edited by urban@abak; 03-08-2007 at 09:16 AM..
Reply With Quote
  #3 (permalink)  
Old 03-08-2007, 12:34 PM
Zimbra Employee
 
Posts: 1,434
Default Thunderbird hack time!

Quote:
Originally Posted by voltcraft View Post
today I noticed that my imported mails with imapsync from an existing courier imap server have the wrong received date.

I thought that --syncinternaldates didn't work but then I saw that zimbra stored the correct date on the right side of the sender's address.
It sounds like --syncinternaldates didn't work. The best way around this is to re-import via imapsync, but import to "user@example.com/tb" instead of "user@example.com". This trailing "/tb" forces the Zimbra IMAP server to look at the Date header instead of looking at the INTERNALDATE during the import.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #4 (permalink)  
Old 03-09-2007, 02:08 AM
Active Member
 
Posts: 43
Default

this works for us. thanks a lot!
Reply With Quote
  #5 (permalink)  
Old 03-09-2007, 08:14 AM
Intermediate Member
 
Posts: 22
Default

is there a way to use the /tb tailer for reindexing the mailbox?
Reply With Quote
  #6 (permalink)  
Old 03-09-2007, 10:14 AM
Zimbra Employee
 
Posts: 1,434
Default No.

Quote:
Originally Posted by voltcraft View Post
is there a way to use the /tb tailer for reindexing the mailbox?
No. We tag a "received" date on a message when it's added to the system. Reindexing just regenerates the fulltext Lucene index for searching and doesn't alter that date.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #7 (permalink)  
Old 03-10-2007, 10:56 AM
Intermediate Member
 
Posts: 22
Default

Today I tried a new import of my mailbox but it didn't work..

I used this command:

Code:
imapsync --nosyncacls --subscribe --syncinternaldates --host1 10.0.0.2 --user1 rene --password1 xxx --host2 localhost --user2 rene@youthtec.at/tb --password2 xxx
Reply With Quote
  #8 (permalink)  
Old 03-10-2007, 11:01 AM
Zimbra Employee
 
Posts: 1,434
Default More info, please...

Quote:
Originally Posted by voltcraft View Post
Today I tried a new import of my mailbox but it didn't work..

Code:
imapsync --nosyncacls --subscribe --syncinternaldates --host1 10.0.0.2 --user1 rene --password1 xxx --host2 localhost --user2 rene@youthtec.at/tb --password2 xxx
Can you elaborate on that? What didn't work?

And does it work if you use the "/tb" suffix but leave off --syncinternaldates?
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #9 (permalink)  
Old 03-10-2007, 11:20 AM
Intermediate Member
 
Posts: 22
Default

Without syncinternaldates it worked! Thanks!
Reply With Quote
  #10 (permalink)  
Old 04-30-2009, 03:09 AM
Member
 
Posts: 11
Smile Must Change Timestamp of Flatfile!!

Got it to work with a shell script!

I was having the same problem, and I must admit this post was very helpful along with some other posts I found on Google regarding how to use imapsync.

However, I tried all of the suggestions here and still I was getting the wrong date on all my imported e-mails. Basically, they were assigned a timestamp of when I actually performed the import.

I did a lot of testing, and I figured out that you actually have to change the timestamp of the file itself. In Linux, you can use the touch -d "date/time string" command.

I wrote a shell script that recursively goes through all of the e-mails in the mail store, extracts the data from the "Date:" header, and then changes the timestamp of the file. Please see the code below:

Code:
#!/bin/bash

# This script changes the file timestamp to be the same as the date/time
# in the Date: header of the email.  This solves problems on mail systems
# such as Zimbra where the date/time is changed to the current date/time
# when you import mail using imapsync.

# Questions/Comments: Jim Ryan <morpheus@post.harvard.edu>

ROOTDIR=""

if [ -n "$1" ]; then
        $ROOTDIR="\$*"
fi

printf "Enter mailbox root directory [%s]: " "$ROOTDIR" > /dev/stdout
read ROOTDIR

while [ ! -d "$ROOTDIR" ]; do
        echo "Not a valid directory."
        printf "Enter mailbox root directory [%s]: " "$ROOTDIR" > /dev/stdout
        read ROOTDIR
done

TMPFILE=`mktemp /tmp/fix_imap_dates.XXXXXXXXX` || exit 1
printf "Temporary file %s created.\n" "$TMPFILE"

find $ROOTDIR -type f -printf "%p\n" 2>/dev/null > "$TMPFILE"

exec 3< "$TMPFILE"        echo "Grep Result is: $GREPRESULT"
        if [ -z "$GREPRESULT" ]; then
                printf "File not an email or has no Date header: %s\n" "$FILENAME"
        else
                DATETIME=`echo "$GREPRESULT" | sed 's/^Date: *//g'`
                printf "Date for Timestamp is: %s\n" "$DATETIME"
                touch -d "$DATETIME" "$FILENAME"
        fi
done
After this, I simply used imapsync without the "/tb" option but with the --syncinternaldates option.

Code:
sudo imapsync --nosyncacls --subscribe --syncinternaldates --host1 localhost --user1 xxxx --host2 www.xxxx.com --user2 xxx --ssl2 --port2 993 --noauthmd5
This all worked perfectly!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.