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
///////////////////////////////////////////////////////////////////////
Bookmarks