[MERGE] fix bug lp:797233 by sbh
bzr revid: tfr@openerp.com-20110630101830-vg83lqij220cs2e5
This commit is contained in:
commit
536d032427
|
@ -116,7 +116,7 @@ class email_server(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
for server in self.browse(cr, uid, ids, context=context):
|
||||
logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail start checking for new emails on %s' % (server.name))
|
||||
logger.notifyChannel(server.type, netsvc.LOG_INFO, 'fetchmail start checking for new emails on %s' % (server.name))
|
||||
context.update({'server_id': server.id, 'server_type': server.type})
|
||||
try:
|
||||
if server.type == 'imap':
|
||||
|
@ -199,7 +199,7 @@ class email_server(osv.osv):
|
|||
|
||||
pop_server.quit()
|
||||
|
||||
logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail fetch %s email(s) from %s' % (numMsgs, server.name))
|
||||
logger.notifyChannel(server.type, netsvc.LOG_INFO, 'fetchmail fetch %s email(s) from %s' % (numMsgs, server.name))
|
||||
|
||||
except Exception, e:
|
||||
logger.notifyChannel(server.type, netsvc.LOG_WARNING, '%s' % (tools.ustr(e)))
|
||||
|
|
|
@ -519,7 +519,7 @@ class mailgate_tool(osv.osv_memory):
|
|||
body = content
|
||||
has_plain_text = True
|
||||
elif part.get_content_maintype() in ('application', 'image'):
|
||||
if filename :
|
||||
if filename and attach:
|
||||
attachments[filename] = part.get_payload(decode=True)
|
||||
else:
|
||||
res = part.get_payload(decode=True)
|
||||
|
|
Loading…
Reference in New Issue