| | |
| | | else |
| | | $this->struct_charset = $this->_structure_charset($structure); |
| | | |
| | | /* |
| | | @TODO: here we can recognize malformed BODYSTRUCTURE and parse |
| | | the message in other way to create our own message structure. |
| | | Example of structure for malformed MIME message: |
| | | ("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 2154 70 NIL NIL NIL) |
| | | |
| | | if ($headers->ctype != 'text/plain' |
| | | && !is_array($structure[0]) && $structure[0] == 'text' |
| | | && !is_array($structure[1]) && $structure[1] == 'plain') |
| | | { } |
| | | */ |
| | | |
| | | $struct = &$this->_structure_part($structure); |
| | | $struct->headers = get_object_vars($headers); |
| | | |
| | |
| | | // convert charset (if text or message part) |
| | | if ($o_part->ctype_primary=='text' || $o_part->ctype_primary=='message') { |
| | | // assume default if no charset specified |
| | | if (empty($o_part->charset)) |
| | | if (empty($o_part->charset) || strtolower($o_part->charset) == 'us-ascii') |
| | | $o_part->charset = $this->default_charset; |
| | | |
| | | $body = rcube_charset_convert($body, $o_part->charset); |