Gravar-mail: Dynamics of adaptive immunity against phage in bacterial populations