Gravar-mail: Optimal learning with excitatory and inhibitory synapses