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

Thread: E-mail Date Sent Problem

  1. #1
    racassel is offline Sugar Community Member
    Join Date
    Sep 2006
    Posts
    20

    Default E-mail Date Sent Problem

    A batch of mail downloaded with the date 01-01-2000 05:00AM,. then some Download 01-01-2000 02:00AM and Some 12-31-1999 7:00PM - instead of the right date sent. I notice in the MySql Table also, and verify this data is in the table email / date_start field. I see others posts on this subject, but, no solutions. Version 4.05b / MySql Version 4.1.19

  2. #2
    pixerp is offline Member
    Join Date
    Jan 2006
    Posts
    8

    Angry Re: E-mail Date Sent Problem

    See Bug 9071 reported on 16-09-2006.
    Status : NEW -> means that noody cared about it !!

  3. #3
    racassel is offline Sugar Community Member
    Join Date
    Sep 2006
    Posts
    20

    Default Re: E-mail Date Sent Problem

    Thank you. I am new to Sugar, Where do I find the 9,000+ bugs list?

    I switched the date preference back to europe 2006-09-21 14:00 format, and now they are coming in correctly.

  4. #4
    Zschech is offline Junior Member
    Join Date
    Sep 2006
    Posts
    3

    Default Re: E-mail Date Sent Problem

    I'm new to sugar, but I have (had) the same problem. I think I found the source (I'm using sugarcrm os 4.5.0b):

    I messed around with the log4php.properties file and activated all logging options... then i followed the various functions that get called when recieving mail and I stumbled over the function to_db() in /include/TimeDate.php
    This function is responsible for converting dates from user defined date formats (i live in Germany: date i.e. 31.12.2006) to db date format (and applying the neccesary timezone conversions)

    What happens is:

    in modules/InboundEmail/InboundEmail.php:
    line 1297: extracted sent time is stored in email object
    Code:
                    $email->date_start      = date($tPref['date'], $unixHeaderDate);
                    $email->time_start      = date($tPref['time'], $unixHeaderDate);
                    $email->type            = 'inbound';
                    $email->date_created    = date($tPref['date']." ".$tPref['time'], $unixHeaderDate);
    line 1345: email object gets saved... TimeDate::to_db() function converts date and time from localized to db format... email is saved in db. At this point date_start and time_start are right...
    Code:
                    $email->save();
                    $email->new_with_id = false; // to allow future saves by UPDATE, instead of INSERT
    under certain conditions $email-save() seems to be called again after this. This time $email->date_start and $email-time_start are already converted to db format. The TimeDate::to_db() function tries to convert them again and fails...

    the solution in my case was adding
    Code:
                    $email->date_start      = date($tPref['date'], $unixHeaderDate);
                    $email->time_start      = date($tPref['time'], $unixHeaderDate);
                    $email->date_created    = date($tPref['date']." ".$tPref['time'], $unixHeaderDate);
    again after the first save (InboundEmail.php, line 1349)...

    the lines before this are:
    Code:
                    $email->save();
                    $email->new_with_id = false; // to allow future saves by UPDATE, instead of INSERT
                ////    ASSIGN APPROPRIATE ATTRIBUTES TO NEW EMAIL OBJECT
                ///////////////////////////////////////////////////////////////////////
    Last edited by Zschech; 2006-09-21 at 09:04 PM.

  5. #5
    racassel is offline Sugar Community Member
    Join Date
    Sep 2006
    Posts
    20

    Default Re: E-mail Date Sent Problem

    Yes. It drive me crazy. I hope you got to the root of the problem. I thought changing the format fixed it, but it did not. It switches back, sometimes when I tab off, and other times when I close Sugar and go back in. As a workaround, I just Archived everthing, and the dates show up correcty in the archive folder. Move them back to the unread box and they go wacky again. Start_date must be compiled from received date or something....... I am just starting with Sugar, love the program, but can not yet recommed open or pay-fer version with this data integrity issue for anyone. E-mail received are critical to medical, legal and sales, financial organizations. I can't imagine who they would not be important to. Except Sugar development team!

  6. #6
    ErikLindquist is offline Sugar Community Member
    Join Date
    Aug 2006
    Posts
    44

    Default Re: E-mail Date Sent Problem

    I was quite impressed with the Sugar4.5 version, up until I hit this issue where the date sent is set to 2000-01-01.

    There are also other minor issues that come and go for apparently no reason. But the date stamp is an issue that is almost a show stopper.

    Erik

  7. #7
    dvandewetering is offline Sugar Community Member
    Join Date
    Sep 2006
    Location
    Netherlands
    Posts
    27

    Default Re: E-mail Date Sent Problem

    Amazing!

    This trick worked for me (Holland here!)

    Hope it will be taken into the next releases as well... and that an upgraden won't mess up the code again!

    Thanks man!

  8. #8
    runtim is offline Member
    Join Date
    Aug 2006
    Posts
    6

    Default Re: E-mail Date Sent Problem

    I had problems as well with the date sent.

    I simply changed the Import/Export Character Set to UTF-8 under My Account Settings.

    It seems to have fixed the issue.

  9. #9
    ErikLindquist is offline Sugar Community Member
    Join Date
    Aug 2006
    Posts
    44

    Default Re: E-mail Date Sent Problem

    I tried the fix submitted by Zschech but it did not work.
    I also tried the UTF-8 fix, which I found was the default on a couple accounts.

    Neither of these fixes worked?

    Erik

  10. #10
    runtim is offline Member
    Join Date
    Aug 2006
    Posts
    6

    Default Re: E-mail Date Sent Problem

    I pretty much gave up until I decided to replace my current versions (4.5.0b) /modules/InboundEmail with (4.2.1).

    My Import/Export Character Set: UTF-8.

    I haven't had any problems since.

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)

Bookmarks

Posting Permissions

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