Failure in IMAP connection

Failure in IMAP connection

Postby Spiros » Wed Jun 04, 2014 10:08 pm

Hello! I'm new to this forum.

I am trying to use python to collect my emails on my NAS and manage them according to my needs. I have two email accounts, one with gmail and the other with my university. I want to synchronize them in a smart way.

When I use my laptop, I can just use imaplib and the following line of code to connect both to GMail (as in the example) and to the university account:

Code: Select all
connection = imaplib.IMAP4_SSL('imap.gmail.com', 993)


This works and I can search emails, fetch them, upload new ones,... When I try the very same code on my NAS I get the following error:

Code: Select all
error                                     Traceback (most recent call last)
<ipython-input-6-78c0b9c36a6a> in <module>()
----> 1 connection = imaplib.IMAP4_SSL('mail.ethz.ch', 993)

/usr/lib/python2.7/imaplib.pyc in __init__(self, host, port, keyfile, certfile)
   1146             self.keyfile = keyfile
   1147             self.certfile = certfile
-> 1148             IMAP4.__init__(self, host, port)
   1149
   1150

/usr/lib/python2.7/imaplib.pyc in __init__(self, host, port)
    161         # Open socket to server.
    162
--> 163         self.open(host, port)
    164
    165         # Create unique tag for this session,

/usr/lib/python2.7/imaplib.pyc in open(self, host, port)
   1158             self.port = port
   1159             self.sock = socket.create_connection((host, port))
-> 1160             self.sslobj = ssl.wrap_socket(self.sock, self.keyfile, self.certfile)
   1161             self.file = self.sslobj.makefile('rb')
   1162

/usr/lib/python2.7/ssl.pyc in wrap_socket(sock, keyfile, certfile, server_side, cert_reqs, ssl_version, ca_certs, do_handshake_on_connect, suppress_ragged_eofs, ciphers)
    379                      do_handshake_on_connect=do_handshake_on_connect,
    380                      suppress_ragged_eofs=suppress_ragged_eofs,
--> 381                      ciphers=ciphers)
    382
    383

/usr/lib/python2.7/ssl.pyc in __init__(self, sock, keyfile, certfile, server_side, cert_reqs, ssl_version, ca_certs, do_handshake_on_connect, suppress_ragged_eofs, ciphers)
    141                                         ciphers)
    142             if do_handshake_on_connect:
--> 143                 self.do_handshake()
    144         self.keyfile = keyfile
    145         self.certfile = certfile

/usr/lib/python2.7/ssl.pyc in do_handshake(self)
    303         """Perform a TLS/SSL handshake."""
    304
--> 305         self._sslobj.do_handshake()
    306
    307     def _real_connect(self, addr, return_errno):

error: [Errno 0] Error


I have the same error for both accounts.

Now to the technical details. My laptop has a normal x86_64 CPU; it runs Ubuntu 14.4 with python 2.7.6. My NAS has an ARM CPU (Feroceon 88FR131 rev 1 (v5l)), runs Debian 7.5 with python 2.7.3.

My guess would be that there is something wrong with SSL on the debian side, but I have no clue of how to verify and solve this. Any suggestions?
Last edited by Yoriz on Wed Jun 04, 2014 10:20 pm, edited 1 time in total.
Reason: First post lock.
Spiros
 
Posts: 1
Joined: Wed Jun 04, 2014 10:00 pm

Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest