ImapamiAction.__init__(self, terminal=True)
self.dest = dest
def process(self, ami, mail):
- ret = ImapamiActionCopy.process(
- self, ami, mail)
- if ret == False:
+ imap = ami.imap
+ dest = self.evaluate(self.dest, ami, mail.msg)
+ imap.create(dest)
+ ret, msg = imap.copy(mail.item, dest)
+ if ret != "OK":
+ ami.logger.warning(
+ "imap copy returned %s: %s" % (ret, str(msg)))
return False
- ret = ImapamiActionDelete.process(
- self, ami, mail)
- if ret == False:
+ ret, msg = imap.store(mail.item, '+FLAGS', '\\Deleted')
+ if ret != "OK":
+ ami.logger.warning(
+ "imap store '%s %s' returned %s: %s" % (
+ cmd, flag, ret, str(msg)))
return False
return True
register(ImapamiActionMove)