[FIX] fetchmail: fix
bzr revid: hmo@tinyerp.com-20110303103740-rza71diijr9hlysf
This commit is contained in:
parent
a2875d6d0d
commit
4ff5f75912
|
@ -185,8 +185,9 @@ class email_server(osv.osv):
|
|||
except Exception, e:
|
||||
logger.notifyChannel(server.type, netsvc.LOG_WARNING, '%s' % (tools.ustr(e)))
|
||||
finally:
|
||||
imap_server.close()
|
||||
imap_server.logout()
|
||||
if imap_server:
|
||||
imap_server.close()
|
||||
imap_server.logout()
|
||||
elif server.type == 'pop':
|
||||
try:
|
||||
pop_server = self.button_confirm_login(cr, uid, [server.id], context=context)
|
||||
|
@ -204,7 +205,8 @@ class email_server(osv.osv):
|
|||
except Exception, e:
|
||||
logger.notifyChannel(server.type, netsvc.LOG_WARNING, '%s' % (tools.ustr(e)))
|
||||
finally:
|
||||
pop_server.quit()
|
||||
if pop_server:
|
||||
pop_server.quit()
|
||||
return True
|
||||
|
||||
email_server()
|
||||
|
|
Loading…
Reference in New Issue