0

I'm trying to connect to an imap server:

mailbox = imaplib.IMAP4_SSL(host=server, port=port)

This results in a timeout:

[Errno 60] Operation timed out

So I tried to increase the timeout:

import socket
socket.setdefaulttimeout(4000)
mailbox = imaplib.IMAP4_SSL(host=server, port=port)

But still the same error. It appears around 115 seconds. What could be the cause for the timeout? I guess it has to be something on the server side then?

user3255061
  • 1,757
  • 1
  • 30
  • 50
  • 1
    Firewall? Are you able to connect to the server with a socket tool? (socat, openssl s_client, etc.) – Max Sep 20 '19 at 14:47

1 Answers1

0

I learned that one can scan the ports (I used nmap), turns out the port was closed.

socat and openssl s_client as mentioned in the comments are useful tools as well for finding out what's going on.

user3255061
  • 1,757
  • 1
  • 30
  • 50