public function listMessages()
    {
        if ( $this->state != self::STATE_TRANSACTION )
        {
            throw new ezcMailTransportException( "Can't call listMessages() on the POP3 transport when not successfully logged in." );
        }

        // send the command
        $this->connection->sendData( "LIST" );
        $response = $this->connection->getLine();
        if ( !$this->isPositiveResponse( $response ) )
        {
            throw new ezcMailTransportException( "The POP3 server sent a negative response to the LIST command: {$response}." );
        }

        // fetch the data from the server and prepare it to be returned.
        $messages = array();
        while ( ( $response = $this->connection->getLine( true ) ) !== "." )
        {
            list( $num, $size ) = explode( ' ', $response );
            $messages[$num] = $size;
        }
        return $messages;
    }
public function listMessages()
    {
        if ( $this->state != self::STATE_TRANSACTION )
        {
            throw new ezcMailTransportException( "Can't call listMessages() on the POP3 transport when not successfully logged in." );
        }

        // send the command
        $this->connection->sendData( "LIST" );
        $response = $this->connection->getLine();
        if ( !$this->isPositiveResponse( $response ) )
        {
            throw new ezcMailTransportException( "The POP3 server sent a negative response to the LIST command: {$response}." );
        }

        // fetch the data from the server and prepare it to be returned.
        $messages = array();
        while ( ( $response = $this->connection->getLine( true ) ) !== "." )
        {
            list( $num, $size ) = explode( ' ', $response );
            $messages[$num] = $size;
        }
        return $messages;
    }
public function listMessages ( ) { if ( $ this -> state != self :: STATE_TRANSACTION ) { throw new ezcMailTransportException ( "Can't call listMessages() on the POP3 transport when not successfully logged in." ) ; } // send the command $ this -> connection -> sendData ( "LIST" ) ; $ response = $ this -> connection -> getLine ( ) ; if ( ! $ this -> isPositiveResponse ( $ response ) ) { throw new ezcMailTransportException ( "The POP3 server sent a negative response to the LIST command: {$response}." ) ; } // fetch the data from the server and prepare it to be returned. $ messages = array ( ) ; while ( ( $ response = $ this -> connection -> getLine ( true ) ) !== "." ) { list ( $ num , $ size ) = explode ( ' ' , $ response ) ; $ messages [ $ num ] = $ size ; } return $ messages ; }
Returns an array of the message numbers on the server and the size of the
messages in bytes.

The format of the returned array is:
<code>
array( message_id => message_size );
</code>

Example:
<code>
array( 2 => 1700, 5 => 1450, 6 => 21043 );
</code>

Before calling this method, a connection to the POP3 server must be
established and a user must be authenticated successfully.

@throws ezcMailTransportException
if there was no connection to the server
or if not authenticated
or if the server sent a negative response
@return array(int)
Returns an array of the message numbers on the server and the size of the messages in bytes .