Gravar-mail: Simple learning rules to cope with changing environments