40 contains(
"as-client" ) ||
41 contains(
"as-proxy" ) ||
42 contains(
"as-server" ) ;
47 return contains(
"verbose" ) ;
52 return contains(
"debug" ) ;
57 bool basic = !contains(
"no-syslog") && !contains(
"as-client") ;
58 bool override = contains(
"syslog" ) ;
59 return override || basic ;
64 return contains(
"log-time" ) ;
69 return contains(
"log-file") ? value(
"log-file") : std::string() ;
74 return value(
"port" , 25U ) ;
82 G::Strings result = m_cl.value(
"interface" ,
",/" ) ;
87 for( G::Strings::iterator p = result.begin() ; p != result.end() ; )
89 if( protocol.empty() || protocol ==
G::Str::head( *p , (*p).find(
'=') , protocol ) )
92 p = result.erase( p ) ;
100 G::Strings result = m_cl.value(
"interface" ,
",/" ) ;
103 for( G::Strings::iterator p = result.begin() ; p != result.end() ; ++p )
105 if( (*p).find(
"client=") == 0U )
111 for( G::Strings::iterator p = result.begin() ; p != result.end() ; ++p )
113 if( (*p).find(
'=') == std::string::npos )
117 return std::string() ;
122 return value(
"admin" , 0U ) ;
128 contains(
"close-stderr") ||
129 contains(
"as-proxy") ||
130 contains(
"as-server") ;
135 return !contains(
"no-daemon") && !contains(
"as-client") ;
140 return contains(
"spool-dir") ?
147 const char * key =
"forward-to" ;
148 if( contains(
"as-client") )
150 else if( contains(
"as-proxy") )
152 return contains(key) ? value(key) : std::string() ;
157 return contains(
"forward") || contains(
"as-client") ;
162 return !contains(
"dont-serve") && !contains(
"as-client") ;
167 return contains(
"immediate") ;
172 return contains(
"poll") && pollingTimeout() > 0U ;
177 return value(
"poll" , 0U ) ;
183 return doPolling() && pollingTimeout() > 60U ;
205 ( contains(
"poll") && pollingTimeout() == 0U ) ||
206 contains(
"as-proxy") ;
211 return value(
"prompt-timeout" , 20U ) ;
216 return ! contains(
"no-smtp" ) ;
221 return contains(
"pop" ) ;
226 return contains(
"pop-by-name" ) ;
231 return contains(
"pop-no-delete" ) ;
236 return value(
"pop-port" , 110U ) ;
241 return contains(
"remote-clients" ) ;
246 return contains(
"admin" ) ;
251 return contains(
"pid-file" ) ;
256 return value(
"pid-file" ) ;
261 return contains(
"filter" ) ;
266 return contains(
"filter") ? value(
"filter") : std::string() ;
271 return contains(
"client-filter") ? value(
"client-filter") : std::string() ;
281 return contains(
"hidden" ) ;
286 return contains(
"client-auth") ? value(
"client-auth") : std::string() ;
291 return contains(
"client-tls" ) ;
296 return contains(
"client-tls-connection" ) ;
301 return value(
"tls-config" , 0U ) ;
306 return contains(
"server-tls") ? value(
"server-tls") : std::string() ;
316 return contains(
"server-auth") ? value(
"server-auth") : std::string() ;
321 return value(
"response-timeout" , 30U * 60U ) ;
326 return value(
"connection-timeout" , 40U ) ;
331 return connectionTimeout() ;
336 return contains(
"domain") ? value(
"domain") : default_ ;
341 return contains(
"user") ? value(
"user") : std::string(
"daemon") ;
346 return contains(
"verifier") ? value(
"verifier") : std::string() ;
351 return contains(
"admin-terminate" ) ;
356 return value(
"size" , 0U ) ;
361 return contains(
"scanner") ? value(
"scanner") : std::string() ;
376 return contains(
"anonymous" ) ;
381 return value(
"filter-timeout" , 5U * 60U ) ;
386 return contains(
"peer-lookup" ) ;
389 bool Main::Configuration::contains(
const char * s )
const
391 return m_cl.contains( s ) ;
394 std::string Main::Configuration::value(
const char * s )
const
396 return m_cl.value( s ) ;
399 unsigned int Main::Configuration::value(
const char * s ,
unsigned int d )
const
401 return m_cl.value( s , d ) ;
bool peerLookup() const
Returns true if there should be some attempt to look up the userid of SMTP peers connected from the t...
bool doSmtp() const
Returns true if listening for smtp connections.
bool immediate() const
Returns true if forwarding should occur as soon as each message body is received and before receipt i...
bool clientOverTls() const
Returns true if using the SMTP over TLS (vs.
std::string verifier() const
Returns the path of an external address verifier program.
std::string serverAddress() const
Returns the downstream server's address string.
bool pollingLog() const
Returns true if polling activity should be logged.
std::string filter() const
Returns the path to a server-side pre-processor.
bool doServing() const
Returns true if running as a server (SMTP, POP, admin or COM).
bool daemon() const
Returns true if running as a daemon.
std::list< std::string > Strings
A std::list of std::strings.
bool anonymous() const
Returns true if the server protocol should be slightly more anonymous.
bool popNoDelete() const
Returns true if pop deletion is to be disabled.
unsigned int popPort() const
Returns the pop port number.
bool allowRemoteClients() const
Returns true if allowing remote clients to connect.
bool closeStderr() const
Returns true if stderr should be closed.
G::Path spoolDir() const
Returns the spool directory.
bool doAdmin() const
Returns true if listening for admin connections.
G::Strings listeningInterfaces(const std::string &protocol=std::string()) const
Returns the listening interface(s).
static std::string tail(const std::string &in, std::string::size_type pos, const std::string &default_=std::string())
Returns the last part of the string after the given position.
bool useSyslog() const
Returns true if generating syslog events.
bool forwardingOnStore() const
Returns true if forwarding should occur as each message is stored, after it is acknowledged.
unsigned int secureConnectionTimeout() const
Returns the timeout for establishing a secure connection.
bool verbose() const
Returns true if doing verbose logging.
std::string serverTlsFile() const
Returns the tls certificate file if the server should support tls.
bool debug() const
Returns true if doing debug-level logging.
unsigned int scannerConnectionTimeout() const
Returns a timeout for connecting to the scanner process.
std::string serverSecretsFile() const
Returns the server-side autentication secrets (password) file.
unsigned int promptTimeout() const
Returns the timeout for getting a prompt from the SMTP server.
static std::string head(const std::string &in, std::string::size_type pos, const std::string &default_=std::string())
Returns the first part of the string up to just before the given position.
std::string nobody() const
Returns the name of an unprivileged user.
A class which deals with the command-line interface to the process, both input and output...
bool log() const
Returns true if doing logging.
unsigned int connectionTimeout() const
Returns the client-side connection timeout value.
static G::Path defaultDirectory()
Returns a default spool directory, such as "/usr/local/var/spool/emailrelay".
std::string fqdn(std::string default_=std::string()) const
Returns the fully-qualified-domain-name override.
unsigned int pollingTimeout() const
Returns the timeout for periodic polling.
std::string logFile() const
Returns the path of a stderr replacement for logging.
unsigned int maxSize() const
Returns the maximum size of submitted messages, or zero.
std::string clientFilter() const
Returns the path to a client-side pre-processor.
std::string pidFile() const
Returns the pid file's path.
bool useFilter() const
Returns true if pre-processing.
Configuration(const CommandLine &cl)
Constructor. The reference is kept.
unsigned int icon() const
Returns the icon selector (win32).
bool withTerminate() const
Returns true if the admin interface should support the terminate command.
bool logTimestamp() const
Returns true if logging output should be timestamped.
std::string clientInterface() const
Returns the sending interface.
bool popByName() const
Returns true if the pop spool directory is modified according to the client name. ...
unsigned int port() const
Returns the main listening port number.
bool forwardingOnDisconnect() const
Returns true if forwarding should occur when the submitter's network connection disconnects.
bool doForwardingOnStartup() const
Returns true if running as a client.
unsigned int adminPort() const
Returns the admin port number.
bool hidden() const
Returns true if the main window is hidden (win32).
unsigned int tlsConfig() const
Returns TLS configuration flags.
std::string scannerAddress() const
Returns the address of a scanner process.
std::string clientSecretsFile() const
Returns the client-side autentication secrets (password) file.
bool usePidFile() const
Returns true if writing a pid file.
static std::string defaultPath()
Returns the default path.
A Path object represents a file system path.
bool doPolling() const
Returns true if doing poll-based forwarding.
bool doPop() const
Returns true if listening for pop connections.
unsigned int scannerResponseTimeout() const
Returns a timeout for talking to the scanner process.
unsigned int responseTimeout() const
Returns the client-side protocol timeout value.
unsigned int filterTimeout() const
Returns the timeout for executing an ansynchronous filter() or clientFilter() program.
bool clientTls() const
Returns true if the client protocol should take account of the server's tls capability.
std::string popSecretsFile() const
Returns the pop-server autentication secrets (password) file.