update header (copy from gmail example)