//unread increment if (!$mail_unseen->date_read) { $unread++; } //read on server + pref + not sent => archived ! if ($mail_unseen->date_read && $archivedOnReception && !$mail_unseen->sent) { $mail_unseen->archived = 1; } //store the usermail if (!($msg = $mail_unseen->store())) { $created++; } //attachments list $pop->cleanTemp(); $attachs = $pop->getListAttachments($_mail); $mail_unseen->attachFiles($attachs, $pop); } else { // si le mail est lu sur MB mais non lu sur IMAP => on le flag if ($mail_unseen->date_read) { $pop->setflag($_mail, "\\Seen"); } } $loop++; } //foreach //set email as read in imap/pop server if ($markReadServer) { $pop->setFlag(implode(",", $unseen), "\\Seen"); } //number of mails gathered CAppUI::stepAjax("CPop-msg-newMsgs", UI_MSG_OK, $unread, $created, $results, $total);