Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Wrong dates in Zimbra Webmail

  1. #1
    voltcraft is offline Intermediate Member
    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 05:53 AM.

  2. #2
    urban@abak is offline Active Member
    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 09:16 AM.

  3. #3
    dkarp is offline Zimbra Employee
    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
    urban@abak is offline Active Member
    Join Date
    Dec 2006
    Posts
    43
    Rep Power
    8

    Default

    this works for us. thanks a lot!

  5. #5
    voltcraft is offline Intermediate Member
    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
    dkarp is offline Zimbra Employee
    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
    voltcraft is offline Intermediate Member
    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
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    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!

  9. #9
    voltcraft is offline Intermediate Member
    Join Date
    Mar 2007
    Posts
    22
    Rep Power
    8

    Default

    Without syncinternaldates it worked! Thanks!

  10. #10
    ChaosFreak is offline Member
    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!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

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