roundcubemail/program/lib/Roundcube/rcube_imap_generic.php
public function clearFolder($mailbox)
    {
        if ($this->countMessages($mailbox) > 0) {
            $res = $this->flag($mailbox, '1:*', 'DELETED');
        }

        if ($res) {
            if ($this->selected === $mailbox) {
                $res = $this->close();
            }
            else {
                $res = $this->expunge($mailbox);
            }
        }

        return $res;
    }
public function clearFolder($mailbox)
    {
        if ($this->countMessages($mailbox) > 0) {
            $res = $this->flag($mailbox, '1:*', 'DELETED');
        }

        if ($res) {
            if ($this->selected === $mailbox) {
                $res = $this->close();
            }
            else {
                $res = $this->expunge($mailbox);
            }
        }

        return $res;
    }
public function clearFolder ( $ mailbox ) { if ( $ this -> countMessages ( $ mailbox ) > 0 ) { $ res = $ this -> flag ( $ mailbox , '1:*' , 'DELETED' ) ; } if ( $ res ) { if ( $ this -> selected === $ mailbox ) { $ res = $ this -> close ( ) ; } else { $ res = $ this -> expunge ( $ mailbox ) ; } } return $ res ; }
Removes all messages in a folder

@param string $mailbox Mailbox name

@return boolean True on success, False on error
Removes all messages in a folder