Results 1 to 10 of 12

Thread: Wrong dates in Zimbra Webmail

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Posts
    22
    Rep Power
    8

    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 04:53 AM.

  2. #2
    Join Date
    Dec 2006
    Posts
    43
    Rep Power
    8

    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 08:16 AM.

  3. #3
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    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!

  4. #4
    Join Date
    Dec 2006
    Posts
    43
    Rep Power
    8

    Default

    this works for us. thanks a lot!

  5. #5
    Join Date
    Mar 2007
    Posts
    22
    Rep Power
    8

    Default

    is there a way to use the /tb tailer for reindexing the mailbox?

  6. #6
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    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!

  7. #7
    Join Date
    Mar 2007
    Posts
    22
    Rep Power
    8

    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

  8. #8
    Join Date
    Apr 2009
    Posts
    11
    Rep Power
    6

    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!

  9. #9
    Join Date
    Nov 2007
    Location
    Berkeley, CA
    Posts
    115
    Rep Power
    7

    Default

    ChaosFreak,

    Would your script work on ANY imported account? I just did a pretty large migration for an individual client the other day. Apparently he is seeing some old emails from 2006 show up with the received timestamp of the date of the import. It's not consistent across his account, it's only on some emails.

    I did not use IMAPSync for the import. I used the Outlook Import Wizard. However, his mail was originally in Outlook Express. I first imported to Outlook, then from Outlook to Zimbra. I haven't had access to his machine since the import, so I can't 100% tell for sure if the timestamp issue was introduced between OE and Outlook, or between Outlook and Zimbra.

    I would appreciate any comments/ideas you might have.

    Thanks in advance!

  10. #10
    Join Date
    Apr 2009
    Posts
    11
    Rep Power
    6

    Default Probably not...

    Sorry for the late response. You can try my script, however I ran my script on the source IMAP server, before importing the mail to Zimbra. Since you have already imported your mail, it probably won't work, since as far as I know Zimbra stores those dates in its database and ignores the file timestamp. I haven't tested this, so it's worth a shot.

Similar Threads

  1. Replies: 26
    Last Post: 04-19-2011, 09:24 AM
  2. Replies: 31
    Last Post: 12-15-2007, 08:05 PM
  3. Logger
    By jholder in forum Installation
    Replies: 24
    Last Post: 03-31-2006, 10:50 AM
  4. Zimbra MTA and CentOS VPS on OpenVZ
    By czaveri in forum Installation
    Replies: 2
    Last Post: 03-20-2006, 08:42 AM
  5. Mail logs
    By Rick Baker in forum Installation
    Replies: 8
    Last Post: 01-17-2006, 03:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •