There are three aspects to spam management: the spam identification threshold, what action to take with messages that meet that threshold, and which domains and email addresses should be exempt (safelisted) from the spam action process. Further, if the chosen action is to deliver the message to the spam folder, configuration should be done to make sure that messages there are deleted after a certain age or after a certain number of messages are stored there.
If a mailbox user has customized spam threshold and action settings, their settings will supercede those of the domain.
If a mailbox user has a customized safelist, the domain safelist + the user safelist will be applied to determine the action to take with email messages to that mailbox user.
AddDomainSpam() The should probably be renamed to ModifyDomainSpam, set threshold and action here
GetDomainSpam() To see the threshold and action
SetDomainSpamCleaner() Set spam folder auto-cleanup here