What happens to the mail after a domain name change?

Once you change your primary domain name all your mailboxes will be converted to the new one.

For example, if you have a mailbox mail@domain1.com and you change your primary domain name to domian2.com, the mailbox will automatically become mail@domain2.com.