Gravar-mail: Optimal resilience of modular interacting networks