Method AddSpamAssassinScanning
- Namespace
- MailFathom.Infrastructure
- Assembly
- MailFathom.Infrastructure.dll
AddSpamAssassinScanning(IServiceCollection)
Registers the spam scanner, which scores whole messages against a daemon deployed beside this service.
public static IServiceCollection AddSpamAssassinScanning(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection.
Returns
- IServiceCollection
The service collection, for chaining.
Remarks
Called only where the scanner switch is on, which is what makes an opt-in nobody took cost nothing: with it off none of these descriptors exists, no address is read, and EmailSpamClassifier resolves no scanner and classifies through the deterministic stage alone. The composed SpamAssassinScannerProfile is the host's to register, because where the daemon is comes from configuration this project does not bind.
The probe is registered beside the scanner rather than always, because startup refuses a switch that is on with nothing behind it, and either one present without the other would turn that refusal into a deployment that scores nothing and says so nowhere.
All three are singletons, and the conversation is the reason: it holds the concurrency permits that bound this process against the daemon, and the corpus identity the startup probe establishes for every scan afterwards. Two instances would be two of each, so the scanner and the probe are handed the same one.
No IHttpClientFactory registration appears here, unlike every other outbound dependency: the daemon speaks
its own line protocol on a TCP port rather than HTTP, so there is no handler chain to bound and the bounds live in
the profile the conversation reads.
Exceptions
- ArgumentNullException
Thrown when
servicesis null.