Take a look at `getHeaders` in `messages.py` ( https://github.com/leapcode/leap_mail/blob/develop/src/leap/mail/imap/messages.py#L615 )
I've joined `headers = dict(...` and `filter_by_cond = [...` in one `for`.

And maybe is time to refactor those two together, idk.