fetch comment by email
@param string $email email address
@param array $sorts sort array
@param integer $offset offset
@param integer $length length
@param integer $status status of comment
@return ezcomComment|null
777213
static function fetchByEmail( $email, $sorts = null, $offset = null, $length = null, $status = false )
    {
        $cond = array();
        $cond['email'] = $email;
        if ( $status !== false )
        {
            $cond['status'] = $status;
        }
        $limit = null;
        if ( !is_null( $offset ) )
        {
           $limit = array();
           $limit = array( 'offset' => $offset, 'length' => $length );
        }
        $return = eZPersistentObject::fetchObjectList( self::definition(), null, $cond, $sorts, $limit );
        return $return;
    }
540185
public function unMarkComment($msg_data_id, $user_comment_id, $index = null) {
        $args = $this->getUnMarkComment()->parameters(
            compact('msg_data_id', 'user_comment_id', 'index'))->json();
        return $args['errcode'] == 0;
    }
878425
public function get_comments( $count = null, $order = 'wp', $type = 'comment', $status = 'approve', $CommentClass = 'Timber\Comment' ) {
		return $this->comments($count, $order, $type, $status, $CommentClass);
	}
1103884
private function getEmailFormat($email, array $flags = array())
    {
        //if email is an array
        if (is_array($email)) {
            //make it into a string
            $email = implode("\n", $email);
        }

        //split the head and the body
        $parts = preg_split("/\n\s*\n/", $email, 2);

        $head = $parts[0];
        $body = null;
        if (isset($parts[1]) && trim($parts[1]) != ')') {
            $body = $parts[1];
        }

        $lines = explode("\n", $head);
        $head = array();
        foreach ($lines as $line) {
            if (trim($line) && preg_match("/^\s+/", $line)) {
                $head[count($head)-1] .= ' '.trim($line);
                continue;
            }

            $head[] = trim($line);
        }

        $head = implode("\n", $head);

        $recipientsTo = $recipientsCc = $recipientsBcc = $sender = array();

        //get the headers
        $headers1   = imap_rfc822_parse_headers($head);
        $headers2   = $this->getHeaders($head);

        //set the from
        $sender['name'] = null;
        if (isset($headers1->from[0]->personal)) {
            $sender['name'] = $headers1->from[0]->personal;
            //if the name is iso or utf encoded
            if (preg_match("/^\=\?[a-zA-Z]+\-[0-9]+.*\?/", strtolower($sender['name']))) {
                //decode the subject
                $sender['name'] = str_replace('_', ' ', mb_decode_mimeheader($sender['name']));
            }
        }

        $sender['email'] = $headers1->from[0]->mailbox . '@' . $headers1->from[0]->host;

        //set the to
        if (isset($headers1->to)) {
            foreach ($headers1->to as $to) {
                if (!isset($to->mailbox, $to->host)) {
                    continue;
                }

                $recipient = array('name'=>null);
                if (isset($to->personal)) {
                    $recipient['name'] = $to->personal;
                    //if the name is iso or utf encoded
                    if (preg_match("/^\=\?[a-zA-Z]+\-[0-9]+.*\?/", strtolower($recipient['name']))) {
                        //decode the subject
                        $recipient['name'] = str_replace('_', ' ', mb_decode_mimeheader($recipient['name']));
                    }
                }

                $recipient['email'] = $to->mailbox . '@' . $to->host;

                $recipientsTo[] = $recipient;
            }
        }

        //set the cc
        if (isset($headers1->cc)) {
            foreach ($headers1->cc as $cc) {
                $recipient = array('name'=>null);
                if (isset($cc->personal)) {
                    $recipient['name'] = $cc->personal;

                    //if the name is iso or utf encoded
                    if (preg_match("/^\=\?[a-zA-Z]+\-[0-9]+.*\?/", strtolower($recipient['name']))) {
                        //decode the subject
                        $recipient['name'] = str_replace('_', ' ', mb_decode_mimeheader($recipient['name']));
                    }
                }

                $recipient['email'] = $cc->mailbox . '@' . $cc->host;

                $recipientsCc[] = $recipient;
            }
        }

        //set the bcc
        if (isset($headers1->bcc)) {
            foreach ($headers1->bcc as $bcc) {
                $recipient = array('name'=>null);
                if (isset($bcc->personal)) {
                    $recipient['name'] = $bcc->personal;
                    //if the name is iso or utf encoded
                    if (preg_match("/^\=\?[a-zA-Z]+\-[0-9]+.*\?/", strtolower($recipient['name']))) {
                        //decode the subject
                        $recipient['name'] = str_replace('_', ' ', mb_decode_mimeheader($recipient['name']));
                    }
                }

                $recipient['email'] = $bcc->mailbox . '@' . $bcc->host;

                $recipientsBcc[] = $recipient;
            }
        }

        //if subject is not set
        if (!isset($headers1->subject) || strlen(trim($headers1->subject)) === 0) {
            //set subject
            $headers1->subject = self::NO_SUBJECT;
        }

        //trim the subject
        $headers1->subject = str_replace(array('<', '>'), '', trim($headers1->subject));

        //if the subject is iso or utf encoded
        if (preg_match("/^\=\?[a-zA-Z]+\-[0-9]+.*\?/", strtolower($headers1->subject))) {
            //decode the subject
            $headers1->subject = str_replace('_', ' ', mb_decode_mimeheader($headers1->subject));
        }

        //set thread details
        $topic  = isset($headers2['thread-topic']) ? $headers2['thread-topic'] : $headers1->subject;
        $parent = isset($headers2['in-reply-to']) ? str_replace('"', '', $headers2['in-reply-to']) : null;

        //set date
        $date = isset($headers1->date) ? strtotime($headers1->date) : null;

        //set message id
        if (isset($headers2['message-id'])) {
            $messageId = str_replace('"', '', $headers2['message-id']);
        } else {
            $messageId = '<eden-no-id-'.md5(uniqid()).'>';
        }

        $attachment = isset($headers2['content-type'])
            && strpos($headers2['content-type'], 'multipart/mixed') === 0;

        $format = array(
            'id'            => $messageId,
            'parent'        => $parent,
            'topic'         => $topic,
            'mailbox'       => 'INBOX',
            'date'          => $date,
            'subject'       => str_replace('’', '\'', $headers1->subject),
            'from'          => $sender,
            'flags'         => $flags,
            'to'            => $recipientsTo,
            'cc'            => $recipientsCc,
            'bcc'           => $recipientsBcc,
            'attachment'    => $attachment);

        if (trim($body) && $body != ')') {
            //get the body parts
            $parts = $this->getParts($email);

            //if there are no parts
            if (empty($parts)) {
                //just make the body as a single part
                $parts = array('text/plain' => $body);
            }

            //set body to the body parts
            $body = $parts;

            //look for attachments
            $attachment = array();
            //if there is an attachment in the body
            if (isset($body['attachment'])) {
                //take it out
                $attachment = $body['attachment'];
                unset($body['attachment']);
            }

            $format['body']         = $body;
            $format['attachment']   = $attachment;
        }

        return $format;
    }
1032783
protected function prepareEmails(array $emails)
    {
        foreach ($emails as $email) {
            $email->setStatus(SpoolEmailStatus::STATUS_SENDING);
            $email->setSentAt(null);
            $this->om->persist($email);
        }

        $this->om->flush();
        reset($emails);

        return $emails;
    }
632546
public function loadByEmail($email)
    {
        $query = $this->handler->createSelectQuery();
        $query->select(
            $this->handler->quoteColumn('contentobject_id', 'ezuser'),
            $this->handler->quoteColumn('login', 'ezuser'),
            $this->handler->quoteColumn('email', 'ezuser'),
            $this->handler->quoteColumn('password_hash', 'ezuser'),
            $this->handler->quoteColumn('password_hash_type', 'ezuser'),
            $this->handler->quoteColumn('is_enabled', 'ezuser_setting'),
            $this->handler->quoteColumn('max_login', 'ezuser_setting')
        )->from(
            $this->handler->quoteTable('ezuser')
        )->leftJoin(
            $this->handler->quoteTable('ezuser_setting'),
            $query->expr->eq(
                $this->handler->quoteColumn('user_id', 'ezuser_setting'),
                $this->handler->quoteColumn('contentobject_id', 'ezuser')
            )
        )->where(
            $query->expr->eq(
                $this->handler->quoteColumn('email', 'ezuser'),
                $query->bindValue($email, null, \PDO::PARAM_STR)
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
861611
public function status(string $listId, string $email): string
    {
        $this->checkListExists($listId);
        $memberId = md5(strtolower($email));
        try {
            $member = $this->api->getMember($listId, $memberId);
        } catch (Throwable $e) {
            if ($this->api->responseCodeNotFound()) {
                return 'not found';
            }
            throw $e;
        }
        if (!$this->memberStatusIsValid($member)) {
            throw new MailchimpException('Unknown error, status value not found: ' . var_export($member, true));
        }
        return $member['status'];
    }
596399
protected function _parseMailbox()
    {
        $this->_comments = array();
        $start = $this->_ptr;

        if (!($ob = $this->_parseNameAddr())) {
            $this->_comments = array();
            $this->_ptr = $start;
            $ob = $this->_parseAddrSpec();
        }

        if ($ob) {
            $ob->comment = $this->_comments;
        }

        return $ob;
    }
588951
public static function check($emails): array
    {
        $result = [];

        if (empty($emails)) {
            return $result;
        }

        $emails = self::handleEmailsInput($emails);

        foreach ($emails as $email) {
            if (!self::isValid($email)) {
                continue;
            }
            if (!in_array($email, $result, true)) {
                $result[] = $email;
            }
        }

        return $result;
    }
1161127
public function checkEmail($seq = 0)
    {
        $action = "check_email";
        $options = array(
            'seq' => $seq,
            'sid_token' => $this->sid_token
        );

        return $this->client->get($action, $options);
    }
449315
public function getUserByEMail(string $email)
    {
        $retval = null;

        if (strlen($email) > 0) {
            $nb_user = CNabuUser::findByEMail($this, $email);
            if ($nb_user instanceof CNabuUser && $nb_user->validateCustomer($this)) {
                $nb_user->setCustomer($this);
                $retval = $nb_user;
            }
        }

        return $retval;
    }
1282580
public function getUserByEmail( $email )
    {
        if ( ! array_key_exists( $email, static::$userCache ) )
        {
            static::$userCache[$email] = $this->getUserMapper()
                                              ->findByEmail( $email );
        }

        return static::$userCache[$email];
    }
230321
public static function reply(InteropMessage $replyMessage, $status = self::ACK, $reason = null)
    {
        $status = null === $status ? self::ACK : $status;

        $result = new static($status, $reason);
        $result->setReply($replyMessage);

        return $result;
    }
576521
public function openComment($msg_data_id, $index = null) {
        $args = $this->getOpenComment()->parameters(
            compact('msg_data_id', 'user_comment_id', 'index'))->json();
        return $args['errcode'] == 0;
    }
127227
public function addComment($shipmentIncrementId, $comment = null, $email = null, $includeInEmail = null)
    {
        return $this->__createAction('order_shipment.addComment', func_get_args());
    }
29601
public function postComment(int $blogArticleId, string $authorName, EmailAddress $authorEmail, string $comment): BlogArticleComment
    {
        $blogArticle = $this->blogArticleRepo->get($blogArticleId);

        $comment = $blogArticle->postComment($authorName, $authorEmail, $comment, $this->clock);

        $this->blogArticleRepo->save($blogArticle);

        return $comment;
    }
754627
protected function get_reply_address($course, $forum, $discussion, $post, $cm, $context) {
        if ($this->can_post($course, $forum, $discussion, $post, $cm, $context)) {
            // Generate a reply-to address from using the Inbound Message handler.
            $this->inboundmanager->set_data($post->id);
            return $this->inboundmanager->generate($this->recipient->id);
        }

        // TODO Check if we can return a string.
        // This will be controlled by the event.
        return null;
    }