[horde] MIME and plain text message

Michael M Slusarz slusarz at horde.org
Wed Apr 12 08:52:34 PDT 2006


Quoting Dmitriy MiksIr <miksir at maker.ru>:

>
>
> Michael M Slusarz wrote:
>> Quoting Dmitriy MiksIr <miksir at maker.ru>:
>>
>>> Hello.
>>> How i understand, all IMAP messages parsed by MIME library. When the
>>> create MIME Part, charset from this MIME part of message used.
>>> But if message plain/text - which charset will be used - default or
>>> from headers of message?
>>
>> from the Content-type header.  If no valid MIME Content-Type header  
>>  is found, then US-ASCII (or, in IMP 4.1.1+, the default viewing   
>> charset) is used.
>>
>>> This question because i got troubles with display plain text 8bit
>>> letter. How i understand, used default charset (us-ascii) even if
>>> charset= set in content-type of message, isn't it?
>>
>> Because your message is not a MIME message - So it defaults to   
>> us-ascii.  I pretty much can guarantee that your message is missing  
>>  a 'MIME-Version' header.
>>
>
> How i understand, it's provided by imap-client - if no MIME-Version
> set, no charset returned (even if charset specify in content-type). But
> why...? Is this broke some RFC?

Yes, because it is not a MIME message.  MIME messages are build on top  
of base RFC 822 messages.  By default, RFC822 messages are always in  
the us-ascii character set.

> Now, i try create workaround for this? For example, fetch and parse
> headers manually in _setInfo method of MIME_Structure, if
> $part->ifparametes is false. But can you tell me, how get message index
> (for MIME_Headers) in _setInfo? Now i try add index to $part structure
> (in imp/lib/MIME/Contents.php)... but may be more simple way?

Other than adding a MIME-Version header to every message, there is no  
way since parsing is entirely handled by c-client.  See  
http://wiki.horde.org/IMPNoMessageText

michael

___________________________________
Michael Slusarz [slusarz at horde.org]


More information about the horde mailing list