Restricting file transferr between two networks

Hi, I have a Openfire server working in my office, it caters two networks. both the network are part of same domain

what I want is people should be able to send and receive files in their own respective networks but they should not be able to send them across networks .I was wondering if there is any means to achieve that. if this is not possible I would like to limit the size of file that can be transferred.

Unfortunately I have not been able to figure out either.

all and any help would be appreciated