38 bool server_side ,
const std::string & identifier ,
unsigned int timeout )
43 return unique_ptr<GSmtp::Filter>(
new NullFilter( eh , server_side ) ) ;
45 else if( p.first ==
"spam" )
47 bool edit = p.third == 1 ;
48 bool read_only = !edit ;
49 bool always_pass = edit ;
50 return unique_ptr<GSmtp::Filter>(
new SpamFilter( eh , server_side , p.second , read_only , always_pass , timeout , timeout ) ) ;
52 else if( p.first ==
"net" )
54 return unique_ptr<GSmtp::Filter>(
new NetworkFilter( eh , server_side , p.second , timeout , timeout ) ) ;
56 else if( p.first ==
"exit" )
62 return unique_ptr<GSmtp::Filter>(
new ExecutableFilter( eh , server_side , p.second ) ) ;
Result tuple for GSmtp::FactoryParser::parse().
static std::string check(const std::string &identifier, bool allow_spam)
Parses and checks an identifier.
A Filter class that passes the name of a message file to a remote process over the network...
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events...
static unsigned int toUInt(const std::string &s)
Converts string 's' to an unsigned int.
static unique_ptr< Filter > newFilter(GNet::ExceptionHandler &, bool server_side, const std::string &identifier, unsigned int timeout)
Returns a Filter on the heap.
A Filter class that does nothing.
static std::string check(const std::string &identifier)
Checks an identifier.
A Filter class that passes the body of a message file to a remote process over the network and option...
static Result parse(const std::string &identifier, bool allow_spam)
Parses an identifier like "/usr/bin/foo" or "net:127.0.0.1:99" returning the type and the specificati...
A Filter class that runs an external helper program.