[saas-2] mass_mailing: message_route_check_bounce produces a stack trace unregistering bounce statistics

Bug #1276097 reported by Olivier Laurent (Acsone)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
OpenERP Publisher's Warranty Team

Bug Description

If the mail_id contained in the "To" address of the bounce message does not match any statistics documents, the method set_bounced returns no ids producing the following stack trace in the calling method:

2014-02-04 09:43:40,085 13240 ERROR comansys_void_saas-2 openerp.addons.fetchmail.fetchmail: Failed to fetch mail from pop server localhost.
Traceback (most recent call last):
  File "/home/openerp-comansys/instance/addons/fetchmail/fetchmail.py", line 229, in fetch_mail
    context=context)
  File "/home/openerp-comansys/instance/addons/mail/mail_thread.py", line 995, in message_process
    routes = self.message_route(cr, uid, msg_txt, msg, model, thread_id, custom_values, context=context)
  File "/home/openerp-comansys/instance/addons/mass_mailing/mail_thread.py", line 68, in message_route
    if not self.message_route_check_bounce(cr, uid, message, context=context):
  File "/home/openerp-comansys/instance/addons/mass_mailing/mail_thread.py", line 59, in message_route_check_bounce
    email_from, email_to, message_id, bounced_mail_id, bounced_model, bounced_thread_id)
UnboundLocalError: local variable 'bounced_model' referenced before assignment

This issue may occur:
- if more than one database share the same incoming mail server (i agree ... not really recommanded), or
- if some statistics documents have been deleted

Anyway, the fetchmail process stops ignoring (forever) all other messages in its incoming queue.

Expected behaviour: if the set_bounced method produces no ids, the message_route_check_bounce method should simply break process and return False.

Many thanks to fix this issue on [saas-2]

Tags: maintenance
Revision history for this message
Olivier Laurent (Acsone) (olivier-laurent) wrote :

Linked to opw-603717

tags: added: maintenance
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.