← Back to team overview

openerp-india team mailing list archive

[Bug 892273] Re: fetchmail mail_gateway don't accept attachment 6.0.3

 

- Confirming for 6.0.3 only, the bug does not exist in trunk.
- Setting importance to low, this only occurs when: document module is installed + mail_gateway is configured + first mail for new thread arrives with an attachment.

Problem (as explained by Xavier):
In case of new emails, mailgate_tool calls first create_record(), and then history(), and both will try to attach the mail's attachment to the new record. This fails when document module is installed, because you can't have twice the same file attached to the same record.

Recommended solution:
The ideal solution would be to cleanup the history() and message_new() (called by create_record) so there would be no duplicated functionality. However this is too risky for stable, it would change the API and requires fixing many modules (all the message_new() implementations) 
So the best solution for stable is to change mailgate_tool.process_email(), and make sure it does not pass the attachments to history() when it is processing a new email: if create_record was called, then do not pass `attach` to history, otherwise pass it.


** Changed in: openobject-server
   Importance: Undecided => Low

** Changed in: openobject-server
       Status: New => Confirmed

** Changed in: openobject-server
    Milestone: None => 6.0.4

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/892273

Title:
  fetchmail mail_gateway don't accept attachment 6.0.3

Status in OpenERP Server:
  Confirmed

Bug description:
  Openerp 6.0.3. Module Fetchmail.

    It's working when I send a simple mail.
  my mail is fetched.
    When my mail have an attachment.
  It's fail with this message.
  WARNING:pop:[02]: Error occurred while validating the field(s) name,parent_id,res_model,res_id: File name must be unique!

    In the code it's the line in mail_gateway/mail_gateway.py
  attachments.append(att_obj.create(cr, uid, {'res_model':case._name,'res_id':case.id,'name': att[0], 'datas': base64.encodestring(att[1])}))
  that's don't work... the name att[0] seem correct...
  I need another module for that's work ? or a config ?

    Module installed :
  base
  base_action_rule
  base_calendar
  base_setup
  board
  crm
  document
  document_webdav
  fetchmail
  knowledge
  mail_gateway
  process
  resource
  web_livechat

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/892273/+subscriptions


References