summaryrefslogtreecommitdiffstats
path: root/gmail-notmuch.py
diff options
context:
space:
mode:
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()