imap = ami.imap
dest = self.evaluate(self.dest, ami, mail.msg)
imap.create(dest)
- ret, msg = imap.copy(mail.item, dest)
+ ret, msg = imap.uid("COPY", mail.item, dest)
if ret != "OK":
ami.logger.warning(
"imap copy returned %s: %s" % (ret, str(msg)))
cmd = '-FLAGS'
flag = '\\' + self.evaluate(self.flag, ami,
mail.msg)
- ret, msg = imap.store(mail.item, cmd, flag)
+ ret, msg = imap.uid("STORE", mail.item, cmd, flag)
if ret != "OK":
ami.logger.warning(
"imap store '%s %s' returned %s: %s" % (
imap = ami.imap
dest = self.evaluate(self.dest, ami, mail.msg)
imap.create(dest)
- ret, msg = imap.copy(mail.item, dest)
+ ret, msg = imap.uid("COPY", mail.item, dest)
if ret != "OK":
ami.logger.warning(
"imap copy returned %s: %s" % (ret, str(msg)))
return False
- ret, msg = imap.store(mail.item, '+FLAGS', '\\Deleted')
+ ret, msg = imap.uid("STORE", mail.item, '+FLAGS', '\\Deleted')
if ret != "OK":
ami.logger.warning(
"imap delete returned %s: %s" % (ret, str(msg)))
criteria = "(%s)" % self.get_criteria(ami)
ami.logger.debug("processing rule %s, inbox %s, imap criteria %s",
self.name, inbox, criteria)
- resp, items = ami.imap.search(None, criteria)
+ resp, items = ami.imap.uid("SEARCH", None, criteria)
if resp != 'OK':
ami.logger.warning(
"search failed: server response = %s, skip rule", resp)
for item in item_list:
mail_data = {'item': item, 'inbox': inbox}
if parts != []:
- resp, data = ami.imap.fetch(item, parts_str)
+ resp, data = ami.imap.uid("FETCH", item, parts_str)
+ print resp, data
if resp != 'OK':
ami.logger.warning(
"search failed: server response = %s, skip item",