SSilence / php-imap-client

a easy solution for simple IMAP email access in php
MIT License
268 stars 138 forks source link

getUnreadMessages($read = true) always marked as unseen #228

Open gomcodoctor opened 5 years ago

gomcodoctor commented 5 years ago

getUnreadMessages($read = true)

$read = true will not work because

protected function imapFetchbody($section)
    {
        /*
     * Update note: We must add FT_PEEK to perserve the unread status of the email.
     * Documentation of this can see seen here: http://php.net/manual/en/function.imap-fetchbody.php under options
     */
        return imap_fetchbody($this->imapStream, $this->id, $section, FT_PEEK );
    }

FT_PEEK is set, which will always mark message as unseen