You can use spam filter to block emails by size.
1. Login to your DirectAdmin Account.
2. In the E-mail Manager section, click on the SPAM Filters icon or type SPAM Filters in the navigation filter box and the option will appear. Click on it.
3. Under Block By from the drop-down menu, choose the Size option.
4. In Value, choose size in KB or MB and enter your value.
5. Click the Block button.
If you have chosen size in MB and have entered the value 5, for example, all emails exceeding 5MB in size will be blocked.