summaryrefslogtreecommitdiff
path: root/addons/fetchmail
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2014-08-22 12:49:39 +0200
committerMartin Trigaux <mat@openerp.com>2014-08-22 14:14:56 +0200
commitb160f99e2d0e5eb2de176f3e3dbcd7f3aa843c22 (patch)
tree3b92c68b08925361e2c5f2336907eed5563f4aac /addons/fetchmail
parent0ab88f54f9b5e6c2396f7a612dc2df1f94ff0c09 (diff)
[FIX] fetchmail: do not delete a failing email when using POP
In case of IMAP, the email is simply set as read but in case of POP, the email is deleted. To avoid loosing data (e.g. misconfiguration of server), the email is kept for POP. Bug lp:1296724, opw 605667
Diffstat (limited to 'addons/fetchmail')
-rw-r--r--addons/fetchmail/fetchmail.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index 515881e8582..4d32cc13139 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -236,12 +236,12 @@ openerp_mailgate: "|/path/to/openerp-mailgate.py --host=localhost -u %(uid)d -p
save_original=server.original,
strip_attachments=(not server.attach),
context=context)
+ pop_server.dele(num)
except Exception:
_logger.exception('Failed to process mail from %s server %s.', server.type, server.name)
failed += 1
if res_id and server.action_id:
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids': [res_id], 'active_model': context.get("thread_model", server.object_id.model)})
- pop_server.dele(num)
cr.commit()
_logger.info("Fetched %d email(s) on %s server %s; %d succeeded, %d failed.", numMsgs, server.type, server.name, (numMsgs - failed), failed)
except Exception: