This question has been flagged
1 Reply
5511 Views

Hello, when i try to test Supplier vs Client (OpenERP) collaboration by mail i get message with the invoice connected to it. But that attached filename is made unreadable (i.e. Test.pdf transformed to =-UTF-8-b-0KHRh9C10YIgMzc5LnBkZg==-= (1)). Any ideas how can i solve this problem?

I found that post on old forum: h**p://forum.openerp.com/forum/topic34484.html

It says that:"...When I use the fetchmail module to collect mails of applicants for HR recruitment the attachment filenames sometimes are not decoded. (Like this: =?UTF-8?B?w4FSVsONWlTFsFLFkF9Uw5xLw5ZSRsOaUsOTR8OJUC5kb2N4?= ) It is problem for us because the attachments are unreadable by simple click with the default applications (Adobe Reader, Word...).

I think it is repairable in the mail_thread.py (message_append function) module using the following patch:

from email.header import decode_header ... for attachment in attachments: fname, fcontent = attachment fname, encoding = decode_header(fname)[0]"

I have exactly same problem, but i can't find mail_thread.py file, may be this solution is made for earlier version??

Avatar
Discard

Sorry no specific advice other than "have you tried updating the 'mail' addons" - solved countless problems myself this way!

Author

Cameron, thank you for your answer. I'm novice in OpenERP, can you show me a right way how to do an update of a module? I've installed the last version a week ago...

For what its worth - Settings>Modules>Installed Modules Search Mail Select Email Gateway Select Upgrade - Do Base as well!

Have you tried saving the attachment and opening it directly?

Author

Now i see the origin of problem. All is all right if the filename has latin symbols. If i try to send attachment with cyrillic filename, then i get it unreadable in OpenERP messages dashboard. I can download it and rename, after that it will open. But that's not good for users... So something is going wrong with message attachment filename. Some decoding functions not works as they can i think.

Boris, did You solve this problem? I can't find answer too.

Best Answer

Look at the _message_extract_payload function, lines 1212 - 1229. Use decode there and you will be set to go.

Avatar
Discard