Odoo Help

Welcome!

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

1

Unreadable attached filename recieved by mail

By
Boris Fleytlikh
on 9/19/13, 1:04 PM 1,907 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!

Cameron
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?

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

Sergey
on 6/8/14, 7:25 AM
0
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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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