c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #13253
[Bug 703958] Re: mail_gateway proposal to add 'headers' item to msg
** Changed in: openobject-addons
Importance: Undecided => Wishlist
** Changed in: openobject-addons
Status: New => Confirmed
** Changed in: openobject-addons
Assignee: (unassigned) => OpenERP R&D Addons Team 1 (openerp-dev-addons1)
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/703958
Title:
mail_gateway proposal to add 'headers' item to msg
Status in OpenObject Addons Modules:
Confirmed
Bug description:
I propose we add a new item to the dictionary, we already have
msg['body'] and msg['from'] etc but "unsupported" headers get lost in
this function, therefor I suggest we add an item msg['headers']
containing pairs of name, value.
Here is how it should look :
=== modified file 'addons/mail_gateway/mail_gateway.py'
--- addons/mail_gateway/mail_gateway.py 2010-11-16 09:51:53 +0000
+++ addons/mail_gateway/mail_gateway.py 2010-12-07 16:39:01 +0000
@@ -481,6 +481,9 @@
if 'X-Priority' in fields:
msg['priority'] = msg_txt.get('X-Priority', '3 (Normal)').split(' ')[0]
+ # Store the other headers
+ msg['headers'] = dict(msg_txt.items())
+
if not msg_txt.is_multipart() or 'text/plain' in msg.get('Content-Type', ''):
encoding = msg_txt.get_content_charset()
body = msg_txt.get_payload(decode=True)
Follow ups
References