- if ($arg_no == 0) {
- if (!isset($msg)) {
- $msg = new message();
- $hdr = new msg_header();
- $hdr->type0 = 'text';
- $hdr->type1 = 'plain';
- $hdr->encoding = 'us-ascii';
- $msg->entity_id = $this->calcEntity($msg);
- } else {
- $msg->header->type0 = 'multipart';
- $msg->type0 = 'multipart';
- while ($read{$i} == '(') {
- $res = $msg->parseStructure($read, $i);
- $i = $res[1];
- $msg->addEntity($res[0]);
- }
- }
- } else {
- switch ($arg_no) {
- case 1:
- /* multipart properties */
- ++$i;
- $res = $this->parseProperties($read, $i);
- $arg_a[] = $res[0];
- $i = $res[1];
- ++$arg_no;
- break;
- case 2:
- if (isset($msg->type0) && ($msg->type0 == 'multipart')) {
- ++$i;
- $res = $msg->parseDisposition($read, $i);
- $arg_a[] = $res[0];
- $i = $res[1];
- } else { /* properties */
- $res = $msg->parseProperties($read, $i);
- $arg_a[] = $res[0];
- $i = $res[1];
- }
- ++$arg_no;
- break;
- case 3:
- if (isset($msg->type0) && ($msg->type0 == 'multipart')) {
- ++$i;
- $res= $msg->parseLanguage($read, $i);
- $arg_a[] = $res[0];
- $i = $res[1];
- }
- case 7:
- if (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822')) {
- $msg->header->type0 = $arg_a[0];
- $msg->type0 = $arg_a[0];
- $msg->header->type1 = $arg_a[1];
- $msg->type1 = $arg_a[1];
- $rfc822_hdr = new rfc822_header();
- $res = $msg->parseEnvelope($read, $i, $rfc822_hdr);
- $i = $res[1] + 1;
- $msg->rfc822_header = $res[0];
- while (($i < $cnt) && ($read{$i} != '(')) {
- ++$i;
- }
+ switch($arg_no) {
+ case 0:
+ if (!isset($msg)) {
+ $msg = new message();
+ $hdr = new msg_header();
+ $hdr->type0 = 'text';
+ $hdr->type1 = 'plain';
+ $hdr->encoding = 'us-ascii';
+ $msg->entity_id = $this->calcEntity($msg);
+ } else {
+ $msg->header->type0 = 'multipart';
+ $msg->type0 = 'multipart';
+ while ($read{$i} == '(') {