IMAP4_SSL, libgmail, GMail and corporate firewall/proxy

Andrea Gavana andrea.gavana at gmail.com
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\gmail.py", line 17, in <module>
    m = imaplib.IMAP4_SSL('imap.gmail.com', 993)
  File "C:\Python26\lib\imaplib.py", line 1138, in __init__
    IMAP4.__init__(self, host, port)
  File "C:\Python26\lib\imaplib.py", line 163, in __init__
    self.open(host, port)
  File "C:\Python26\lib\imaplib.py", line 1149, in open
    self.sock = socket.create_connection((host, port))
  File "C:\Python26\lib\socket.py", 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\gmail2.py", line 10, in <module>
    ga.login()
  File "C:\Python26\lib\site-packages\libgmail.py", line 305, in login
    pageData = self._retrievePage(req)
  File "C:\Python26\lib\site-packages\libgmail.py", line 348, in _retrievePage
    resp = self.opener.open(req)
  File "C:\Python26\lib\site-packages\mechanize\_opener.py", line 193, in open
    response = urlopen(self, req, data)
  File "C:\Python26\lib\site-packages\mechanize\_urllib2_fork.py",
line 344, in _open
    '_open', req)
  File "C:\Python26\lib\site-packages\mechanize\_urllib2_fork.py",
line 332, in _call_chain
    result = func(*args)
  File "C:\Python26\lib\site-packages\mechanize\_urllib2_fork.py",
line 1171, in https_open
    return self.do_open(conn_factory, req)
  File "C:\Python26\lib\site-packages\gmail_transport.py", 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\_urllib2_fork.py",
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.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
http://thedoomedcity.blogspot.com/2010/03/removal-group-nightmare.html <==



More information about the Python-list mailing list