Update sql to rearrange mail settings properly.