← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 703958] Re: mail_gateway proposal to add 'headers' item to msg

 

I second that..

When handling incoming mails, it is always desired to keep as much of the 
original information as possible.

To your suggestion, I would like to make 3 remarks
 - have known "useless" headers, that we should safely discard (if any), just 
to keep our db's from bloating.
 - have support for multiple items per header (sth. like the "Received:" 
header, if we decide to keep it)
 - have distinction of headers we wish to retransmit (what if the message 
comes from /their/ CRM and we ought to keep their "tag"? ) and ones that we 
store in our db (for later inspection) but won't pass on to next party at 
replies/forwards.

-- 
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 OpenERP Modules (addons):
  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)





References