roundcubemail/program/lib/Roundcube/rcube_imap_generic.php
public function expunge($mailbox, $messages = null)
    {
        if (!$this->select($mailbox)) {
            return false;
        }

        if (!$this->data['READ-WRITE']) {
            $this->setError(self::ERROR_READONLY, "Mailbox is read-only");
            return false;
        }

        // Clear internal status cache
        $this->clear_status_cache($mailbox);

        if (!empty($messages) && $messages != '*' && $this->hasCapability('UIDPLUS')) {
            $messages = self::compressMessageSet($messages);
            $result   = $this->execute('UID EXPUNGE', array($messages), self::COMMAND_NORESPONSE);
        }
        else {
            $result = $this->execute('EXPUNGE', null, self::COMMAND_NORESPONSE);
        }

        if ($result == self::ERROR_OK) {
            $this->selected = null; // state has changed, need to reselect
            return true;
        }

        return false;
    }
public function expunge($mailbox, $messages = null)
    {
        if (!$this->select($mailbox)) {
            return false;
        }

        if (!$this->data['READ-WRITE']) {
            $this->setError(self::ERROR_READONLY, "Mailbox is read-only");
            return false;
        }

        // Clear internal status cache
        $this->clear_status_cache($mailbox);

        if (!empty($messages) && $messages != '*' && $this->hasCapability('UIDPLUS')) {
            $messages = self::compressMessageSet($messages);
            $result   = $this->execute('UID EXPUNGE', array($messages), self::COMMAND_NORESPONSE);
        }
        else {
            $result = $this->execute('EXPUNGE', null, self::COMMAND_NORESPONSE);
        }

        if ($result == self::ERROR_OK) {
            $this->selected = null; // state has changed, need to reselect
            return true;
        }

        return false;
    }
public function expunge ( $ mailbox , $ messages = null ) { if ( ! $ this -> select ( $ mailbox ) ) { return false ; } if ( ! $ this -> data [ 'READ-WRITE' ] ) { $ this -> setError ( self :: ERROR_READONLY , "Mailbox is read-only" ) ; return false ; } // Clear internal status cache $ this -> clear_status_cache ( $ mailbox ) ; if ( ! empty ( $ messages ) && $ messages != '*' && $ this -> hasCapability ( 'UIDPLUS' ) ) { $ messages = self :: compressMessageSet ( $ messages ) ; $ result = $ this -> execute ( 'UID EXPUNGE' , array ( $ messages ) , self :: COMMAND_NORESPONSE ) ; } else { $ result = $ this -> execute ( 'EXPUNGE' , null , self :: COMMAND_NORESPONSE ) ; } if ( $ result == self :: ERROR_OK ) { $ this -> selected = null ; // state has changed, need to reselect return true ; } return false ; }
Executes EXPUNGE command

@param string       $mailbox  Mailbox name
@param string|array $messages Message UIDs to expunge

@return boolean True on success, False on error
Executes EXPUNGE command