diff options
| author | Harry (OpenERP) <hmo@tinyerp.com> | 2011-03-03 16:07:40 +0530 |
|---|---|---|
| committer | Harry (OpenERP) <hmo@tinyerp.com> | 2011-03-03 16:07:40 +0530 |
| commit | 4ff5f75912df44cba5465a1db3f41ae88a9faccc (patch) | |
| tree | f368d13a4fa389c3e21cd7b2576b3e9a6980e6d6 /addons/fetchmail/fetchmail.py | |
| parent | a2875d6d0d5be8803001b9797e5809a255d9b3e2 (diff) | |
[FIX] fetchmail: fix
bzr revid: hmo@tinyerp.com-20110303103740-rza71diijr9hlysf
Diffstat (limited to 'addons/fetchmail/fetchmail.py')
| -rw-r--r-- | addons/fetchmail/fetchmail.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py index 296d592396a..4b2b44a5414 100644 --- a/addons/fetchmail/fetchmail.py +++ b/addons/fetchmail/fetchmail.py @@ -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() |
