openeclass/modules/auth/methods/pop3.php
/* ListMessages method - the $message argument indicates the number of a
     message to be listed.  If you specify an empty string it will list all
     messages in the mail box.  The $unique_id flag indicates if you want
     to list the each message unique identifier, otherwise it will
     return the size of each message listed.  If you list all messages the
     result will be returned in an array. */
ListMessages method - the $message argument indicates the number of a
message to be listed.  If you specify an empty string it will list all
messages in the mail box.  The $unique_id flag indicates if you want
to list the each message unique identifier, otherwise it will
return the size of each message listed.  If you list all messages the
result will be returned in an array.
ListMessages method - the $message argument indicates the number of a message to be listed . If you specify an empty string it will list all messages in the mail box . The $unique_id flag indicates if you want to list the each message unique identifier otherwise it will return the size of each message listed . If you list all messages the result will be returned in an array .
Function ListMessages($message,$unique_id)
	{
		if($this->state!="TRANSACTION")
			return($this->SetError("connection is not in TRANSACTION state"));
		if($unique_id)
			$list_command="UIDL";
		else
			$list_command="LIST";
		if($this->PutLine("$list_command".($message ? " ".$message : ""))==0)
			return($this->SetError("Could not send the $list_command command"));
		$response=$this->GetLine();
		if(GetType($response)!="string")
			return($this->SetError("Could not get message list command response"));
		if($this->Tokenize($response," ")!="+OK")
			return($this->SetError("Could not get the message listing: ".$this->Tokenize("\r\n")));
		if($message=="")
		{
			for($messages=array();;)
			{
				$response=$this->GetLine();
				if(GetType($response)!="string")
					return($this->SetError("Could not get message list response"));
				if($response==".")
					break;
				$message=intval($this->Tokenize($response," "));
				if($unique_id)
					$messages[$message]=$this->Tokenize(" ");
				else
					$messages[$message]=intval($this->Tokenize(" "));
			}
			return($messages);
		}
		else
		{
			$message=intval($this->Tokenize(" "));
			$value=$this->Tokenize(" ");
			return($unique_id ? $value : intval($value));
		}
	}
Function ListMessages ( $ message , $ unique_id ) { if ( $ this -> state != " TRANSACTION " ) return ( $ this -> SetError ( " connection is not in TRANSACTION state " ) ) ; if ( $ unique_id ) $ list_command = " UIDL " ; else $ list_command = " LIST " ; if ( $ this -> PutLine ( " $ list_command " . ( $ message ? " " . $ message : " " ) ) == 0 ) return ( $ this -> SetError ( " Could not send the  $ list_command  command " ) ) ; $ response = $ this -> GetLine ( ) ; if ( GetType ( $ response ) != " string " ) return ( $ this -> SetError ( " Could not get message list command response " ) ) ; if ( $ this -> Tokenize ( $ response , " " ) != " +OK " ) return ( $ this -> SetError ( " Could not get the message listing:  " . $ this -> Tokenize ( " \r \n " ) ) ) ; if ( $ message == " " ) { for ( $ messages = array ( ) ; ; ) { $ response = $ this -> GetLine ( ) ; if ( GetType ( $ response ) != " string " ) return ( $ this -> SetError ( " Could not get message list response " ) ) ; if ( $ response == " . " ) break ; $ message = intval ( $ this -> Tokenize ( $ response , " " ) ) ; if ( $ unique_id ) $ messages [ $ message ] = $ this -> Tokenize ( " " ) ; else $ messages [ $ message ] = intval ( $ this -> Tokenize ( " " ) ) ; } return ( $ messages ) ; } else { $ message = intval ( $ this -> Tokenize ( " " ) ) ; $ value = $ this -> Tokenize ( " " ) ; return ( $ unique_id ? $ value : intval ( $ value ) ) ; } }
ListMessages method - the $message argument indicates the number of a
message to be listed.
ListMessages method - the $message argument indicates the number of a message to be listed .