#ifndef _H_SPAMFILTER #define _H_SPAMFILTER // Your filter receives a pointer to the core server through ISpamFilter::ConfigureFrom() interface ISMailServer; // LPFNREJECTED is optional for returning details about spam to the host typedef VOID (WINAPI* LPFNREJECTED)(LPSTR lpszSender, LPSTR lpszHeaders, LPSTR lpszSpamTag, LPVOID lpParam); // Implement ISpamFilter to build a filter compatible with SimbeyMail interface ISpamFilter { virtual VOID ReleaseFilter (VOID) = 0; virtual VOID ConfigureFrom (ISMailServer* lpServer) = 0; virtual BOOL ProcessLetter (LPSTR lpszUser, LPSTR lpszFile, LPSTR lpszHeader, INT cHeader, BOOL bFromProxy) = 0; virtual VOID SetRejectionHandler (LPFNREJECTED lpfnRejected, LPVOID lpParam) = 0; virtual BOOL TrainUsingSpam (LPSTR lpszUser, LPSTR lpszSpamFile) = 0; virtual BOOL TrainUsingHam (LPSTR lpszUser, LPSTR lpszHamFile) = 0; virtual VOID EnableFilter (LPSTR lpszUser, BOOL bEnabled) = 0; virtual BOOL CheckEnabled (LPSTR lpszUser) = 0; virtual BOOL AddSafeAddress (LPSTR lpszAddress) = 0; virtual BOOL RemoveSafeAddress (LPSTR lpszAddress) = 0; virtual BOOL CheckSafeAddress (LPSTR lpszAddress) = 0; virtual BOOL GetSafeAddress (LONG index, LPSTR lpszAddress) = 0; }; // Export GetSpamFilter() from your SPAMFILTER.DLL BOOL WINAPI GetSpamFilter (ISpamFilter** lplpFilter); // SMailSvc.exe and ServerGui.exe only look for a filter named SPAMFILTER.DLL, but there's // nothing stopping you from building and using multiple filter DLLs managed by a parent // filter named SPAMFILTER.DLL #endif