Define the foreign key on mailbox's side.

fix #543