summaryrefslogtreecommitdiffstats
path: root/gmail-notmuch.py
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-12-07 18:23:16 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2012-12-07 18:23:16 +0100
commitda3a8aa9bc88405b41253a7d96bada93e8e1e50c (patch)
treef04bd552a5d57fbe73bbefa517216326743dbd69 /gmail-notmuch.py
parentGet labels all in one swoop. (diff)
downloadgmail-notmuch-da3a8aa9bc88405b41253a7d96bada93e8e1e50c.tar.xz
gmail-notmuch-da3a8aa9bc88405b41253a7d96bada93e8e1e50c.zip
Reconnect if neccessary.
Diffstat (limited to 'gmail-notmuch.py')
-rwxr-xr-xgmail-notmuch.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gmail-notmuch.py b/gmail-notmuch.py
index e8adc32..11f14bf 100755
--- a/gmail-notmuch.py
+++ b/gmail-notmuch.py
@@ -65,6 +65,12 @@ def main():
logout(imap)
sys.exit(0)
+ try:
+ imap.noop()
+ except IMAP4_SSL.abort:
+ print("Server disconnected us.")
+ imap = login(options)
+
download_new_messages(imap, database, new_messages, destination)
database.close()