Boundary mass-exchange conditions in the form of the Newton and Dalton laws