IMAP4_SSL, libgmail, GMail and corporate firewall/proxy

Andrea Gavana andrea.gavana at
Thu Feb 17 03:56:29 EST 2011

Hi Malcolm,

On 17 February 2011 11:44, Malcolm Greene wrote:
> Andrea,
> What type of result do you get trying port 993 ?

    Thank you for your answer. I have tried that, with imaplib and
libgmail. This is what I get with imaplib:

Traceback (most recent call last):
  File "D:\MyProjects\", line 17, in <module>
    m = imaplib.IMAP4_SSL('', 993)
  File "C:\Python26\lib\", line 1138, in __init__
    IMAP4.__init__(self, host, port)
  File "C:\Python26\lib\", line 163, in __init__, port)
  File "C:\Python26\lib\", line 1149, in open
    self.sock = socket.create_connection((host, port))
  File "C:\Python26\lib\", line 514, in create_connection
    raise error, msg
socket.error: [Errno 10061] No connection could be made because the
target machine actively refused it

And this with libgmail:

Traceback (most recent call last):
  File "D:\MyProjects\", line 10, in <module>
  File "C:\Python26\lib\site-packages\", line 305, in login
    pageData = self._retrievePage(req)
  File "C:\Python26\lib\site-packages\", line 348, in _retrievePage
    resp =
  File "C:\Python26\lib\site-packages\mechanize\", line 193, in open
    response = urlopen(self, req, data)
  File "C:\Python26\lib\site-packages\mechanize\",
line 344, in _open
    '_open', req)
  File "C:\Python26\lib\site-packages\mechanize\",
line 332, in _call_chain
    result = func(*args)
  File "C:\Python26\lib\site-packages\mechanize\",
line 1171, in https_open
    return self.do_open(conn_factory, req)
  File "C:\Python26\lib\site-packages\", line 143, in do_open
    return ClientCookie.HTTPSHandler.do_open(self,
ProxyHTTPSConnection.new_auth(self.proxy, self.proxy_user,
self.proxy_passwd), req)
  File "C:\Python26\lib\site-packages\mechanize\",
line 1118, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 10060] A connection attempt
failed because the connected party did not properly respond after a
period of time, or established connection failed because connected
host has failed to respond>

This thing is driving me crazy, and I'm not even doing it for fun...

Thank you for your suggestions.


"Imagination Is The Only Weapon In The War Against Reality."

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever. <==

More information about the Python-list mailing list