Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ configparser==5.0.1
emlx==1.0.0
darkdetect==0.1.1
keyring==21.5.0
keepalive-socket==0.0.1
6 changes: 2 additions & 4 deletions src/mailbox_imap.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import collections
import os.path
import pickle
import keepalive

from src.mailbox_message import MailboxCleanerMessage

imaplib._MAXLINE = 10000000 # pylint: disable=protected-access
TCP_KEEPALIVE = 0x10

__author__ = "Alexander Willner"
__copyright__ = "Copyright 2020, Alexander Willner"
Expand Down Expand Up @@ -79,9 +79,7 @@ def login(self):

self.imap.sock.setsockopt(
socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
self.imap.sock.setsockopt(
socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
self.imap.sock.setsockopt(socket.IPPROTO_TCP, TCP_KEEPALIVE, 3)
keepalive.set(self.imap.sock)
self._load_cache()
except socket.gaierror as error:
raise SystemExit('Login failed (wrong server?): %s' %
Expand Down