Mail.dll is an IMAP/POP3 client, it's not a server side component.
It can of course run on the server side and perform service related tasks, however
it accesses messages only after they are put in the INBOX (or any father folder) by the email server, not before that.
Most servers have a spam extensions included in them that work automatically.
If for some reason you's like to evaluate if doenloaded messages are spam or not you can train and use BayesianMailFilter
class:
https://www.limilabs.com/blog/net-email-spam-filter