Implement Incoming Iterable in the client
As I see it, the implementation of this should offer a clean way of iterating over the pending emails in the incoming box. I think here goes any abstraction that's needed to write a simple and clean iteration loop, where the logic is not mixed up with implementation details:
for item in self.incoming:
for consumer in self.consumers:
clear = yield consumer.decrypt(item)
parts = yield consumer.process(clear)
saved = yield consumer.save(parts)
self.delete(item)
Also, any error catching belongs here.
Edited by Kali Kaneko