logging.debug("Setting message %s from mailbox %s as seen",
mid.decode('iso-8859-1'), mailbox[2])
try:
- session.update_message(mid.decode('iso-8859-1'), mailbox[2])
+ session.set_message_seen(mid.decode('iso-8859-1'))
except UserWarning as ex:
logging.error(ex)
continue
'''
-mail_iterator.py - The module contains the MailIterator class.
+imap-mark-seen.py - Tool to mark all e-mails as seen
Copyright (c) 2012 Intra2net AG
Author: Plamen Dimitrov and Thomas Jarosch
mailid_list = data[0].split()
return mailid_list
- def update_message(self, mid, mailbox):
+ def set_message_seen(self, mid):
"""Sets the \\Seen flag for a message."""
try:
# Work around unsolicited server responses in imaplib by clearing them
self.mail_con.response('STORE')
- result, data = self.mail_con.uid('STORE', mid, '+FLAGS', "(\Seen)")
+ _result, data = self.mail_con.uid('STORE', mid, '+FLAGS', "(\Seen)")
logging.debug("New flags for message %s are %s", mid, data)
except (self.mail_con.error):
raise UserWarning("Could not set the flags for the e-mail " + mid.decode('iso-8859-1') + ".")
'''
-restore-mail-inject.py - Tool to inject mails via IMAP
+imap-mark-seen.py - Tool to mark all e-mails as seen
Copyright (c) 2012 Intra2net AG
Author: Plamen Dimitrov and Thomas Jarosch
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-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.
'''
import logging
def emit(self, record):
"""Increase number of warnings found"""
-
self.detected_problems += 1
-
\ No newline at end of file