Basic refactoring and Tom's recommendations
[imap-fix-internaldate] / mail_iterator.py
index 1119945..be7964d 100644 (file)
@@ -13,10 +13,6 @@ This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
-
-Add '-t' argument when running the module for a test mode.
-For a detailed list of each message with a date conflict change
-the 'log_level' in the configuration file from '30' to '20'.
 '''
 
 import imaplib
@@ -29,6 +25,12 @@ UIDVAL_RESP = re.compile(r'(?P<name>.*) \(UIDVALIDITY (?P<uidval>.*)\)')
 class MailIterator:
     """This class communicates with the e-mail server."""
 
+    # class attributes
+    # IMAP4_SSL for connection with an IMAP server
+    mail_con = None
+    # list of tuples (uidvalidity, mailboxname) for the retrieved mailboxes
+    mailboxes = None
+
     def __init__(self, server, username, password):
         """Creates a connection and a user session."""
         self.mail_con = imaplib.IMAP4_SSL(server)