32 m_file_store(file_store)
37 bool server_side ,
const std::string & identifier ,
unsigned int timeout )
42 return std::make_unique<NullFilter>( es , server_side ) ;
44 else if( p.first ==
"spam" )
48 bool edit = p.third == 1 ;
49 bool read_only = !edit ;
50 bool always_pass = edit ;
51 return std::make_unique<SpamFilter>( es , m_file_store , p.second , read_only , always_pass , timeout , timeout ) ;
53 else if( p.first ==
"net" )
55 return std::make_unique<NetworkFilter>( es , m_file_store , p.second , timeout , timeout ) ;
57 else if( p.first ==
"exit" )
59 return std::make_unique<NullFilter>( es , server_side ,
G::Str::toUInt(p.second) ) ;
63 return std::make_unique<ExecutableFilter>( es , m_file_store , server_side , p.second , timeout ) ;
A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer.
static Result parse(const std::string &identifier, bool allow_spam)
Parses an identifier like "/usr/bin/foo" or "net:127.0.0.1:99" or "net:/run/spamd....
A concrete implementation of the MessageStore interface dealing in paired flat files.
FilterFactoryFileStore(FileStore &)
Constructor.
std::unique_ptr< Filter > newFilter(GNet::ExceptionSink, bool server_side, const std::string &identifier, unsigned int timeout) override
Returns a Filter on the heap.
static unsigned int toUInt(const std::string &s)
Converts string 's' to an unsigned int.
Result tuple for GSmtp::FactoryParser::parse().