lib/Util.php
public function getMails($domainName, $orderNumbers = null, \Closure $callbackFunction = null)
    {
        $orList    = ' OR ';
        $whereList = ' BODY "'.$domainName.'"';
        $whereList .= ' SUBJECT "'.$domainName.'"';

        if (is_array($orderNumbers)) {
            foreach ($orderNumbers as $orderNumber) {
                $orList .= ' OR OR ';
                $whereList .= ' BODY "'.$orderNumber.'"';
                $whereList .= ' SUBJECT "'.$orderNumber.'"';
            }
        }

        $search = $orList.' '.$whereList;

        return $this
            ->imapHelper
            ->fetchMails($this->imapAdapter, $search, false, false, $callbackFunction);
    }
public function getMails($domainName, $orderNumbers = null, \Closure $callbackFunction = null)
    {
        $orList    = ' OR ';
        $whereList = ' BODY "'.$domainName.'"';
        $whereList .= ' SUBJECT "'.$domainName.'"';

        if (is_array($orderNumbers)) {
            foreach ($orderNumbers as $orderNumber) {
                $orList .= ' OR OR ';
                $whereList .= ' BODY "'.$orderNumber.'"';
                $whereList .= ' SUBJECT "'.$orderNumber.'"';
            }
        }

        $search = $orList.' '.$whereList;

        return $this
            ->imapHelper
            ->fetchMails($this->imapAdapter, $search, false, false, $callbackFunction);
    }
@param string   $domainName
@param null     $orderNumbers
@param \Closure $callbackFunction

@return array