Citando Timo Sirainen tss@iki.fi:
All the data comes from lib-mail/message-decoder.c. Hmm. Looks like it tries to force giving only valid UTF-8 output. I guess it should have some flag or something that makes it do that only for text/* parts, not for binary parts. OK, implemented, see if it works with this and using the flag:
It is working now but I needed to do some changes on your code.
When you check charset_utf8 and charset_trans you have a problem on attachments case. Attachments part do not have any charset defined on headers so, by default, charset_utf8=1 and charset_trans is garbage (I have no idea where that garbage came from).
To avoid this problem swap the some lines of code that set ctx->binary_input to the function's beginning.
Please see the attachment to checked any problem that may exist.
Thank you, Rui Carneiro
Portugalmail, Comunicações S.A. www.portugalmail.net