public static function overrideExternalReportVariables($created_by) { global $sugar_config; $theUser = new User(); if (isset($_REQUEST['schedulerCall']) && $_REQUEST['schedulerCall'] == "true") { $theUser->retrieve($created_by); $current_user = $theUser; $allowExportGeneratedFile = true; $schedulerCall = true; } else { $userId = isset($sugar_config["BSS_Admin_WebService_User_Id"]) ? $sugar_config["BSS_Admin_WebService_User_Id"] : $created_by; $theUser->retrieve($userId); $current_user = $theUser; $allowExportGeneratedFile = false; $schedulerCall = false; } $theUser->getUserDateTimePreferences(); $userPrefs = $theUser->getUserDateTimePreferences(); $externalUserDateFormat = $userPrefs["date"]; $externalUserDateTimeFormat = $userPrefs["date"] . " " . $userPrefs["time"]; return array("theUser" => $theUser, "current_user" => $current_user, "allowExportGeneratedFile" => $allowExportGeneratedFile, "schedulerCall" => $schedulerCall, "externalUserDateFormat" => $externalUserDateFormat, "externalUserDateTimeFormat" => $externalUserDateTimeFormat); }
public function testgetUserDateTimePreferences() { //unset and reconnect Db to resolve mysqli fetch exeception global $db; unset($db->database); $db->checkConnection(); $user = new User(); $user->retrieve(1); $result = $user->getUserDateTimePreferences(); $this->assertTrue(is_array($result)); $this->assertTrue(isset($result['date'])); $this->assertTrue(isset($result['time'])); $this->assertTrue(isset($result['userGmt'])); $this->assertTrue(isset($result['userGmtOffset'])); }
function set_notification_body($xtpl, $task) { global $app_list_strings; global $timedate; $notifyUser = $task->current_notify_user; $prefDate = User::getUserDateTimePreferences($notifyUser); $xtpl->assign("TASK_SUBJECT", $task->name); //MFH #13507 $xtpl->assign("TASK_PRIORITY", isset($task->priority) ? $app_list_strings['task_priority_dom'][$task->priority] : ""); $xtpl->assign("TASK_DUEDATE", $timedate->to_display_date_time($task->date_due . " " . $task->time_due, true, true, $notifyUser) . " " . $prefDate['userGmt']); $xtpl->assign("TASK_STATUS", isset($task->status) ? $app_list_strings['task_status_dom'][$task->status] : ""); $xtpl->assign("TASK_DESCRIPTION", $task->description); return $xtpl; }
function set_notification_body($xtpl, $call) { global $sugar_config; global $app_list_strings; global $current_user; global $app_list_strings; global $timedate; $prefDate = User::getUserDateTimePreferences($call->current_notify_user); $x = date($prefDate['date'] . " " . $prefDate['time'], strtotime($call->date_start . " " . $call->time_start)); $xOffset = $timedate->handle_offset($x, $prefDate['date'] . " " . $prefDate['time'], true, $current_user); if (strtolower(get_class($call->current_notify_user)) == 'contact') { $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'] . '/index.php?entryPoint=acceptDecline&module=Calls&contact_id=' . $call->current_notify_user->id . '&record=' . $call->id); } elseif (strtolower(get_class($call->current_notify_user)) == 'lead') { $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'] . '/index.php?entryPoint=acceptDecline&module=Calls&lead_id=' . $call->current_notify_user->id . '&record=' . $call->id); } else { $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'] . '/index.php?entryPoint=acceptDecline&module=Calls&user_id=' . $call->current_notify_user->id . '&record=' . $call->id); } $xtpl->assign("CALL_TO", $call->current_notify_user->new_assigned_user_name); $xtpl->assign("CALL_SUBJECT", $call->name); $xtpl->assign("CALL_STARTDATE", $xOffset . " " . (!empty($app_list_strings['dom_timezones_extra'][$prefDate['userGmtOffset']]) ? $app_list_strings['dom_timezones_extra'][$prefDate['userGmtOffset']] : $prefDate['userGmt'])); $xtpl->assign("CALL_HOURS", $call->duration_hours); $xtpl->assign("CALL_MINUTES", $call->duration_minutes); $xtpl->assign("CALL_STATUS", isset($call->status) ? $app_list_strings['call_status_dom'][$call->status] : ""); $xtpl->assign("CALL_DESCRIPTION", $call->description); return $xtpl; }
function set_notification_body($xtpl, &$meeting) { global $sugar_config; global $app_list_strings; global $current_user; global $timedate; // cn: bug 9494 - passing a contact breaks this call $notifyUser = $meeting->current_notify_user->object_name == 'User' ? $meeting->current_notify_user : $current_user; // cn: bug 8078 - fixed call to $timedate $prefDate = User::getUserDateTimePreferences($notifyUser); if (strtolower(get_class($meeting->current_notify_user)) == 'contact') { $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'] . '/index.php?entryPoint=acceptDecline&module=Meetings&contact_id=' . $meeting->current_notify_user->id . '&record=' . $meeting->id); } elseif (strtolower(get_class($meeting->current_notify_user)) == 'lead') { $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'] . '/index.php?entryPoint=acceptDecline&module=Meetings&lead_id=' . $meeting->current_notify_user->id . '&record=' . $meeting->id); } else { $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'] . '/index.php?entryPoint=acceptDecline&module=Meetings&user_id=' . $meeting->current_notify_user->id . '&record=' . $meeting->id); } $xtpl->assign("MEETING_TO", $meeting->current_notify_user->new_assigned_user_name); $xtpl->assign("MEETING_SUBJECT", trim($meeting->name)); $xtpl->assign("MEETING_STATUS", isset($meeting->status) ? $app_list_strings['meeting_status_dom'][$meeting->status] : ""); $xtpl->assign("MEETING_STARTDATE", $timedate->to_display_date_time($meeting->date_start, true, true, $notifyUser) . " " . $prefDate['userGmt']); $xtpl->assign("MEETING_HOURS", $meeting->duration_hours); $xtpl->assign("MEETING_MINUTES", $meeting->duration_minutes); $xtpl->assign("MEETING_DESCRIPTION", $meeting->description); return $xtpl; }
/** * shiny new importOneEmail() method * @param msgNo int */ function importOneEmail($msgNo) { $GLOBALS['log']->debug('InboundEmail processing 1 email-----------------------------------------------------------------------------------------'); global $timedate; global $app_list_strings; global $sugar_config; global $current_user; $header = imap_headerinfo($this->conn, $msgNo); $fullHeader = imap_fetchheader($this->conn, $msgNo); // raw headers /////////////////////////////////////////////////////////////////////// //// DUPLICATE CHECK if ($this->importDupeCheck($header->message_id, $msgNo, $header, $fullHeader)) { $GLOBALS['log']->debug('*********** NO duplicate found, continuing with processing.'); $structure = imap_fetchstructure($this->conn, $msgNo); // map of email /////////////////////////////////////////////////////////////////// //// CREATE SEED EMAIL OBJECT if (!class_exists('Email')) { require_once 'modules/Emails/Email.php'; } $email = new Email(); $email->mailbox_id = $this->id; $message = array(); $email->id = create_guid(); $email->new_with_id = true; //forcing a GUID here to prevent double saves. //// END CREATE SEED EMAIL /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// GET RAW EMAIL $GLOBALS['log']->debug('*********** Importing RAW email.'); $raw = $this->importRaw($msgNo); $email->raw_source = $raw; //// END GET RAW EMAIL /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// PREP SYSTEM USER if (empty($current_user)) { // I-E runs as admin, get admin prefs require_once 'modules/Users/User.php'; $current_user = new User(); $current_user->getSystemUser(); } $tPref = $current_user->getUserDateTimePreferences($current_user); //// END USER PREP /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// CALCULATE CORRECT SENT DATE/TIME FOR EMAIL if (!empty($header->date)) { $headerDate = isset($header->date) && !empty($header->date) ? $header->date : $header->Date; // need to hack PHP/windows' bad handling of strings when using POP3 if (strstr($headerDate, '+0000 GMT')) { $headerDate = str_replace('GMT', '', $headerDate); } elseif (!strtotime($headerDate)) { $headerDate = 'now'; // catch non-standard format times. } else { // cn: bug 9196 parse the GMT offset if (strpos($headerDate, '-') || strpos($headerDate, '+')) { // make sure last 5 chars are [+|-]nnnn $gmtEmail = trim(substr($headerDate, -5, 5)); $posNeg = substr($gmtEmail, 0, 1); $gmtHours = substr($gmtEmail, 1, 2); $gmtMins = substr($gmtEmail, -2, 2); // get seconds $secsHours = $gmtHours * 60 * 60; $secsTotal = $secsHours + $gmtMins * 60; $secsTotal = $posNeg == '-' ? $secsTotal : -1 * $secsTotal; } } } else { $headerDate = 'now'; } $unixHeaderDate = strtotime($headerDate); if (isset($secsTotal)) { // this gets the timestamp to true GMT-0 $unixHeaderDate += $secsTotal; } if (strtotime('Jan 1, 2001') > $unixHeaderDate) { $unixHeaderDate = strtotime('now'); } // now get it to user's datetime format for save $gmt0dateTime = $timedate->to_display_date_time(date('Y-m-d H:i:s', $unixHeaderDate)); $gmt0dateTime = $timedate->swap_formats($gmt0dateTime, $timedate->get_date_time_format(), $timedate->get_db_date_time_format()); $unixHeaderDate = strtotime($gmt0dateTime); //// END CALCULATE CORRECT SENT DATE/TIME FOR EMAIL /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// ASSIGN APPROPRIATE ATTRIBUTES TO NEW EMAIL OBJECT // handle UTF-8/charset encoding in the ***headers*** $email->name = $this->handleMimeHeaderDecode($header->subject); //handleCharsetTranslation($subjectDecoded[0]->text, $subjectDecoded[0]->charset); $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); $email->status = 'unread'; // this is used in Contacts' Emails SubPanel if (!empty($header->toaddress)) { $email->to_name = $this->handleTranserEncoding($this->handleMimeHeaderDecode($header->toaddress), $structure->encoding); } if (!empty($header->to)) { $email->to_addrs = $this->convertImapToSugarEmailAddress($header->to); } $email->from_name = $this->handleTranserEncoding($this->handleMimeHeaderDecode($header->fromaddress), $structure->encoding); $email->from_addr = $this->convertImapToSugarEmailAddress($header->from); if (!empty($header->cc)) { $email->cc_addrs = $this->convertImapToSugarEmailAddress($header->cc); } $email->reply_to_name = $this->handleTranserEncoding($this->handleMimeHeaderDecode($header->reply_toaddress), $structure->encoding); $email->reply_to_email = $this->convertImapToSugarEmailAddress($header->reply_to); $email->intent = $this->mailbox_type; $email->message_id = $this->compoundMessageId; // filled by importDupeCheck(); // handle multi-part email bodies $email->description = $this->getMessageText($msgNo, 'PLAIN', $structure, $fullHeader); // runs through handleTranserEncoding() already $email->description_html = $this->getMessageText($msgNo, 'HTML', $structure, $fullHeader); // runs through handleTranserEncoding() already // empty() check for body content if (empty($email->description)) { $GLOBALS['log']->debug('InboundEmail Message (id:' . $email->message_id . ') has no body'); } // assign_to group $email->assigned_user_id = $this->group_id; $email->save(); $email->new_with_id = false; // to allow future saves by UPDATE, instead of INSERT //// ASSIGN APPROPRIATE ATTRIBUTES TO NEW EMAIL OBJECT /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// HANDLE EMAIL ATTACHEMENTS OR HTML TEXT // parts defines attachements - be mindful of .html being interpreted as an attachment if ($structure->type == 1 && !empty($structure->parts)) { $GLOBALS['log']->debug('InboundEmail found multipart email - saving attachments if found.'); $this->saveAttachments($msgNo, $structure->parts, $email->id); } elseif ($structure->type == 0) { $uuemail = $this->isUuencode($email->description) ? true : false; /* * UUEncoded attachments - legacy, but still have to deal with it * format: * begin 777 filename.txt * UUENCODE * * end */ // set body to the filtered one if ($uuemail) { $email->description = $this->handleUUEncodedEmailBody($email->description, $email->id); $email->retrieve($email->id); $email->save(); } } else { if ($this->port != 110) { $GLOBALS['log']->debug('InboundEmail found a multi-part email (id:' . $messageId . ') with no child parts to parse.'); } else { $GLOBALS['log']->debug('InboundEmail found a multi-part email with no child parts to parse - BUT we\'re using POP3, so we suck.'); } } //// END HANDLE EMAIL ATTACHEMENTS OR HTML TEXT /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// LINK APPROPRIATE BEANS TO NEWLY SAVED EMAIL $contactAddr = $this->handleLinking($email); //// END LINK APPROPRIATE BEANS TO NEWLY SAVED EMAIL /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// MAILBOX TYPE HANDLING $this->handleMailboxType($email, $header); //// END MAILBOX TYPE HANDLING /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// SEND AUTORESPONSE $this->handleAutoresponse($email, $contactAddr); //// END SEND AUTORESPONSE /////////////////////////////////////////////////////////////////// //// END IMPORT ONE EMAIL /////////////////////////////////////////////////////////////////// } else { // only log if not POP3; pop3 iterates through ALL mail if ($this->protocol != 'pop3') { $GLOBALS['log']->info("InboundEmail found a duplicate email: " . $header->message_id); } } //// END DUPLICATE CHECK /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// //// DEAL WITH THE MAILBOX imap_setflag_full($this->conn, $msgNo, '\\SEEN'); // if delete_seen, mark msg as deleted if ($this->delete_seen == 1) { imap_setflag_full($this->conn, $msgNo, '\\DELETED'); } $GLOBALS['log']->debug('********************************* InboundEmail finished import of 1 email: ' . $email->name); //// END DEAL WITH THE MAILBOX /////////////////////////////////////////////////////////////////////// }
/** * shiny new importOneEmail() method * @param int msgNo * @param bool forDisplay * @param clean_email boolean, default true, */ function importOneEmail($msgNo, $uid, $forDisplay = false, $clean_email = true) { $GLOBALS['log']->debug("InboundEmail processing 1 email {$msgNo}-----------------------------------------------------------------------------------------"); global $timedate; global $app_strings; global $app_list_strings; global $sugar_config; global $current_user; // Bug # 45477 // So, on older versions of PHP (PHP VERSION < 5.3), // calling imap_headerinfo and imap_fetchheader can cause a buffer overflow for exteremly large headers, // This leads to the remaining messages not being read because Sugar crashes everytime it tries to read the headers. // The workaround is to mark a message as read before making trying to read the header of the msg in question // This forces this message not be read again, and we can continue processing remaining msgs. // UNCOMMENT THIS IF YOU HAVE THIS PROBLEM! See notes on Bug # 45477 // $this->markEmails($uid, "read"); $header = imap_headerinfo($this->conn, $msgNo); $fullHeader = imap_fetchheader($this->conn, $msgNo); // raw headers // reset inline images cache $this->inlineImages = array(); // handle messages deleted on server if (empty($header)) { if (!isset($this->email) || empty($this->email)) { $this->email = new Email(); } $q = ""; if ($this->isPop3Protocol()) { $this->email->name = $app_strings['LBL_EMAIL_ERROR_MESSAGE_DELETED']; $q = "DELETE FROM email_cache WHERE message_id = '{$uid}' AND ie_id = '{$this->id}' AND mbox = '{$this->mailbox}'"; } else { $this->email->name = $app_strings['LBL_EMAIL_ERROR_IMAP_MESSAGE_DELETED']; $q = "DELETE FROM email_cache WHERE imap_uid = {$uid} AND ie_id = '{$this->id}' AND mbox = '{$this->mailbox}'"; } // else // delete local cache $r = $this->db->query($q); $this->email->date_sent = $timedate->nowDb(); return false; //return "Message deleted from server."; } /////////////////////////////////////////////////////////////////////// //// DUPLICATE CHECK $dupeCheckResult = $this->importDupeCheck($header->message_id, $header, $fullHeader); if ($forDisplay || $dupeCheckResult) { $GLOBALS['log']->debug('*********** NO duplicate found, continuing with processing.'); $structure = imap_fetchstructure($this->conn, $msgNo); // map of email /////////////////////////////////////////////////////////////////// //// CREATE SEED EMAIL OBJECT $email = new Email(); $email->isDuplicate = $dupeCheckResult ? false : true; $email->mailbox_id = $this->id; $message = array(); $email->id = create_guid(); $email->new_with_id = true; //forcing a GUID here to prevent double saves. //// END CREATE SEED EMAIL /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// PREP SYSTEM USER if (empty($current_user)) { // I-E runs as admin, get admin prefs $current_user = new User(); $current_user->getSystemUser(); } $tPref = $current_user->getUserDateTimePreferences(); //// END USER PREP /////////////////////////////////////////////////////////////////// if (!empty($header->date)) { $unixHeaderDate = $timedate->fromString($header->date); } /////////////////////////////////////////////////////////////////// //// HANDLE EMAIL ATTACHEMENTS OR HTML TEXT //// Inline images require that I-E handle attachments before body text // parts defines attachments - be mindful of .html being interpreted as an attachment if ($structure->type == 1 && !empty($structure->parts)) { $GLOBALS['log']->debug('InboundEmail found multipart email - saving attachments if found.'); $this->saveAttachments($msgNo, $structure->parts, $email->id, 0, $forDisplay); } elseif ($structure->type == 0) { $uuemail = $this->isUuencode($email->description) ? true : false; /* * UUEncoded attachments - legacy, but still have to deal with it * format: * begin 777 filename.txt * UUENCODE * * end */ // set body to the filtered one if ($uuemail) { $email->description = $this->handleUUEncodedEmailBody($email->description, $email->id); $email->retrieve($email->id); $email->save(); } } else { if ($this->port != 110) { $GLOBALS['log']->debug('InboundEmail found a multi-part email (id:' . $msgNo . ') with no child parts to parse.'); } } //// END HANDLE EMAIL ATTACHEMENTS OR HTML TEXT /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// ASSIGN APPROPRIATE ATTRIBUTES TO NEW EMAIL OBJECT // handle UTF-8/charset encoding in the ***headers*** global $db; $email->name = $this->handleMimeHeaderDecode($header->subject); $email->date_start = !empty($unixHeaderDate) ? $timedate->asUserDate($unixHeaderDate) : ""; $email->time_start = !empty($unixHeaderDate) ? $timedate->asUserTime($unixHeaderDate) : ""; $email->type = 'inbound'; $email->date_created = !empty($unixHeaderDate) ? $timedate->asUser($unixHeaderDate) : ""; $email->status = 'unread'; // this is used in Contacts' Emails SubPanel if (!empty($header->toaddress)) { $email->to_name = $this->handleMimeHeaderDecode($header->toaddress); $email->to_addrs_names = $email->to_name; } if (!empty($header->to)) { $email->to_addrs = $this->convertImapToSugarEmailAddress($header->to); } $email->from_name = $this->handleMimeHeaderDecode($header->fromaddress); $email->from_addr_name = $email->from_name; $email->from_addr = $this->convertImapToSugarEmailAddress($header->from); if (!empty($header->cc)) { $email->cc_addrs = $this->convertImapToSugarEmailAddress($header->cc); } if (!empty($header->ccaddress)) { $email->cc_addrs_names = $this->handleMimeHeaderDecode($header->ccaddress); } // if $email->reply_to_name = $this->handleMimeHeaderDecode($header->reply_toaddress); $email->reply_to_email = $this->convertImapToSugarEmailAddress($header->reply_to); if (!empty($email->reply_to_email)) { $email->reply_to_addr = $email->reply_to_name; } $email->intent = $this->mailbox_type; $email->message_id = $this->compoundMessageId; // filled by importDupeCheck(); $oldPrefix = $this->imagePrefix; if (!$forDisplay) { // Store CIDs in imported messages, convert on display $this->imagePrefix = "cid:"; } // handle multi-part email bodies $email->description_html = $this->getMessageText($msgNo, 'HTML', $structure, $fullHeader, $clean_email); // runs through handleTranserEncoding() already $email->description = $this->getMessageText($msgNo, 'PLAIN', $structure, $fullHeader, $clean_email); // runs through handleTranserEncoding() already $this->imagePrefix = $oldPrefix; // empty() check for body content if (empty($email->description)) { $GLOBALS['log']->debug('InboundEmail Message (id:' . $email->message_id . ') has no body'); } // assign_to group if (!empty($_REQUEST['user_id'])) { $email->assigned_user_id = $_REQUEST['user_id']; } else { // Samir Gandhi : Commented out this code as its not needed //$email->assigned_user_id = $this->group_id; } //Assign Parent Values if set if (!empty($_REQUEST['parent_id']) && !empty($_REQUEST['parent_type'])) { $email->parent_id = $_REQUEST['parent_id']; $email->parent_type = $_REQUEST['parent_type']; $mod = strtolower($email->parent_type); $rel = array_key_exists($mod, $email->field_defs) ? $mod : $mod . "_activities_emails"; //Custom modules rel name if (!$email->load_relationship($rel)) { return FALSE; } $email->{$rel}->add($email->parent_id); } // override $forDisplay w/user pref if ($forDisplay) { if ($this->isAutoImport()) { $forDisplay = false; // triggers save of imported email } } if (!$forDisplay) { $email->save(); $email->new_with_id = false; // to allow future saves by UPDATE, instead of INSERT //// ASSIGN APPROPRIATE ATTRIBUTES TO NEW EMAIL OBJECT /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// LINK APPROPRIATE BEANS TO NEWLY SAVED EMAIL //$contactAddr = $this->handleLinking($email); //// END LINK APPROPRIATE BEANS TO NEWLY SAVED EMAIL /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// MAILBOX TYPE HANDLING $this->handleMailboxType($email, $header); //// END MAILBOX TYPE HANDLING /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //// SEND AUTORESPONSE if (!empty($email->reply_to_email)) { $contactAddr = $email->reply_to_email; } else { $contactAddr = $email->from_addr; } if (!$this->isMailBoxTypeCreateCase()) { $this->handleAutoresponse($email, $contactAddr); } //// END SEND AUTORESPONSE /////////////////////////////////////////////////////////////////// //// END IMPORT ONE EMAIL /////////////////////////////////////////////////////////////////// } } else { // only log if not POP3; pop3 iterates through ALL mail if ($this->protocol != 'pop3') { $GLOBALS['log']->info("InboundEmail found a duplicate email: " . $header->message_id); //echo "This email has already been imported"; } return false; } //// END DUPLICATE CHECK /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// //// DEAL WITH THE MAILBOX if (!$forDisplay) { imap_setflag_full($this->conn, $msgNo, '\\SEEN'); // if delete_seen, mark msg as deleted if ($this->delete_seen == 1 && !$forDisplay) { $GLOBALS['log']->info("INBOUNDEMAIL: delete_seen == 1 - deleting email"); imap_setflag_full($this->conn, $msgNo, '\\DELETED'); } } else { // for display - don't touch server files? //imap_setflag_full($this->conn, $msgNo, '\\UNSEEN'); } $GLOBALS['log']->debug('********************************* InboundEmail finished import of 1 email: ' . $email->name); //// END DEAL WITH THE MAILBOX /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// //// TO SUPPORT EMAIL 2.0 $this->email = $email; if (empty($this->email->et)) { $this->email->email2init(); } return true; }