summaryrefslogtreecommitdiff
path: root/addons/fetchmail/fetchmail.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2012-08-14 17:26:34 +0200
committerThibault Delavallée <tde@openerp.com>2012-08-14 17:26:34 +0200
commitaac03b547ddf71f064b2ee55e1a401c03f850372 (patch)
tree2c4ef01d16a7073f16bca21a11c3e1038b81a581 /addons/fetchmail/fetchmail.py
parenta381c0adce6ff6a6db3ca34d24cd13a65f5d1a39 (diff)
parentcaa053c252d29a31bf7f4300d7b47860fdba9f1e (diff)
[MERGE] Merged with addons/trunk.
bzr revid: tde@openerp.com-20120814152634-ix63oxwcyrfkku4t
Diffstat (limited to 'addons/fetchmail/fetchmail.py')
-rw-r--r--addons/fetchmail/fetchmail.py26
1 files changed, 10 insertions, 16 deletions
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index 62b2775a056..544a4f81b96 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -189,14 +189,11 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
result, data = imap_server.search(None, '(UNSEEN)')
for num in data[0].split():
result, data = imap_server.fetch(num, '(RFC822)')
- if server.object_id:
- res_id = mail_thread.message_process(cr, uid, server.object_id.model,
- data[0][1],
- save_original=server.original,
- strip_attachments=(not server.attach),
- context=context)
- else:
- res_id = mail_thread.message_catchall(cr, uid, data[0][1])
+ res_id = mail_thread.message_process(cr, uid, server.object_id.model,
+ data[0][1],
+ save_original=server.original,
+ strip_attachments=(not server.attach),
+ context=context)
if res_id and server.action_id:
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
imap_server.store(num, '+FLAGS', '\\Seen')
@@ -217,14 +214,11 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
for num in range(1, numMsgs + 1):
(header, msges, octets) = pop_server.retr(num)
msg = '\n'.join(msges)
- if server.object_id:
- res_id = mail_thread.message_process(cr, uid, server.object_id.model,
- msg,
- save_original=server.original,
- strip_attachments=(not server.attach),
- context=context)
- else:
- res_id = mail_thread.message_catchall(cr, uid, data[0][1])
+ res_id = mail_thread.message_process(cr, uid, server.object_id.model,
+ msg,
+ save_original=server.original,
+ strip_attachments=(not server.attach),
+ context=context)
if res_id and server.action_id:
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
pop_server.dele(num)