I'm pretty sure you want to get (far) away from Network Solutions and move to FastMail (or an equivalent), which will let you do just what you want... See, for example:I would like a mail provider that allows me to exclude incoming email by TLD [top-level domain]. The vast majority of spam I get comes from domains like *.icu, *.faith, *.stream, etc. This would make good spam filtering very easy... if I could do it. Network Solutions' mail, which I've used to host my domain mail for years, lets me write rules base on subject and content...
FastMail said:Sieve scripts
Sieve is a programming language for filtering incoming emails. Fastmail's flexible rules system provides most users with filtering functionality, but advanced users may choose to write custom Sieve scripts for complicated filtering (such as time-based rules).
A Sieve script consists of a number of tests which are applied to incoming mail; if an email matches a test, then the actions associated with that test are performed.
Sieve scripts can be used to automatically delete or forward messages; to send autoreplies; to sort emails into folders as they arrive; to mark messages as read or flagged; to test messages for spam or viruses; or to reject messages at or after delivery. Sieve.info has more information on Sieve and its uses.
To create custom Sieve scripts, go to the Settings → Rules screen and click on Edit custom Sieve code at the bottom of the screen.
The rules system creates a Sieve script behind the scenes, and the advanced rule editing functionality allows you to write additional filtering actions to supplement your existing rules.