def __getitem__(self, key): path, info = self.toc[key] msg = MaildirMessage(open(path).read()) msg.set_flags(parse_info(info)) msg.msgkey = key return msg