Odoo Help


Unreadable attached filename recieved by mail

Boris Fleytlikh
on 9/19/13, 1:04 PM 2,848 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??

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

on 9/23/13, 6:41 AM

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...

Boris Fleytlikh
on 9/23/13, 6:47 AM

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?

on 9/23/13, 6:09 PM

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 Fleytlikh
on 9/25/13, 6:53 AM

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

on 6/8/14, 7:25 AM

Mariusz Mizgier

--Mariusz Mizgier--
| 4 1 7
SOPOT, Poland
--Mariusz Mizgier--

OpenERP developer

Mariusz Mizgier
On 6/8/14, 8:46 AM

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/19/13, 1:04 PM
Seen: 2848 times
Last updated: 6/20/16, 8:14 AM