/**
  * @param EmailSendReceive $emailSendCheck
  *
  * @return Swift_Mime_MimePart
  */
 protected function buildMessage(EmailSendReceive $emailSendCheck)
 {
     $message = Swift_Message::newInstance($emailSendCheck->getSubject())->setFrom($emailSendCheck->getFrom())->setTo($emailSendCheck->getTo())->setBody($emailSendCheck->getBody());
     return $message;
 }
 /**
  * @param EmailSendReceive $emailSendCheckI
  *
  * @throws EmailReceiveCheckException
  */
 private function performReceive(EmailSendReceive $emailSendCheckI)
 {
     try {
         $mails = $this->getMailbox()->searchMailbox(sprintf('FROM %s SUBJECT "%s"', $emailSendCheckI->getFrom(), $emailSendCheckI->getSubject()));
         $this->timeReceiveCheck($emailSendCheckI);
         if (count($mails) > 0) {
             $this->deleteReceivedEmails($mails, $emailSendCheckI);
         }
     } catch (ImapException $e) {
         $emailSendCheckI->setStatus(EmailSendReceive::STATUS_RECEIVED_ERROR);
         throw EmailReceiveCheckException::internalProblem($e);
     }
 }