Fix/large email queries 2

WIP
@jbau