From ad2ccdb623ffaaa200c506a27d0c1e7120625e99 Mon Sep 17 00:00:00 2001
From: pavetok
Date: Fri, 25 Apr 2014 23:22:27 +0400
Subject: [PATCH] usage without ssl
---
src/ImapLibrary/__init__.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/ImapLibrary/__init__.py b/src/ImapLibrary/__init__.py
index e79d465..459e270 100644
--- a/src/ImapLibrary/__init__.py
+++ b/src/ImapLibrary/__init__.py
@@ -16,14 +16,15 @@ class ImapLibrary(object):
ROBOT_LIBRARY_VERSION = VERSION
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
- port = 993
-
- def open_mailbox(self, server, user, password):
+ def open_mailbox(self, server, user, password, port=993, ssl=False):
"""
Open the mailbox on a mail server with a valid
authentication.
"""
- self.imap = imaplib.IMAP4_SSL(server, self.port)
+ if ssl:
+ self.imap = imaplib.IMAP4_SSL(server, int(port))
+ else:
+ self.imap = imaplib.IMAP4(server, int(port))
self.imap.login(user, password)
self.imap.select()
self._init_walking_multipart()