Main::Configuration Class Reference

An interface for returning application configuration information. More...

#include <configuration.h>

List of all members.

Public Member Functions

 Configuration (const CommandLine &cl)
 Constructor. The reference is kept.
unsigned int port () const
 Returns the main listening port number.
G::Strings listeningInterfaces () const
 Returns the listening interface(s).
std::string firstListeningInterface () const
 A convenience method returning the first listeningInterface().
std::string clientInterface () const
 Returns the sending interface.
bool closeStderr () const
 Returns true if stderr should be closed.
bool log () const
 Returns true if doing logging.
bool verbose () const
 Returns true if doing verbose logging.
bool debug () const
 Returns true if doing debug-level logging.
bool useSyslog () const
 Returns true if generating syslog events.
bool logTimestamp () const
 Returns true if logging output should be timestamped.
bool daemon () const
 Returns true if running as a daemon.
bool doForwardingOnStartup () const
 Returns true if running as a client.
bool doServing () const
 Returns true if running as a server (SMTP, POP, admin or COM).
bool doSmtp () const
 Returns true if listening for smtp connections.
bool doPop () const
 Returns true if listening for pop connections.
bool popByName () const
 Returns true if the pop spool directory is modified according to the client name.
bool popNoDelete () const
 Returns true if pop deletion is to be disabled.
bool doAdmin () const
 Returns true if listening for admin connections.
unsigned int adminPort () const
 Returns the admin port number.
unsigned int popPort () const
 Returns the pop port number.
bool allowRemoteClients () const
 Returns true if allowing remote clients to connect.
G::Path spoolDir () const
 Returns the spool directory.
std::string serverAddress () const
 Returns the downstream server's address string.
bool usePidFile () const
 Returns true if writing a pid file.
std::string pidFile () const
 Returns the pid file's path.
bool useFilter () const
 Returns true if pre-processing.
std::string filter () const
 Returns the path to a server-side pre-processor.
std::string clientFilter () const
 Returns the path to a client-side pre-processor.
unsigned int filterTimeout () const
 Returns the timeout for executing an ansynchronous filter() or clientFilter() program.
unsigned int icon () const
 Returns the icon selector (win32).
bool hidden () const
 Returns true if the main window is hidden (win32).
unsigned int responseTimeout () const
 Returns the client-side protocol timeout value.
unsigned int connectionTimeout () const
 Returns the client-side connection timeout value.
unsigned int promptTimeout () const
 Returns the timeout for getting a prompt from the SMTP server.
std::string clientSecretsFile () const
 Returns the client-side autentication secrets (password) file.
std::string serverSecretsFile () const
 Returns the server-side autentication secrets (password) file.
std::string popSecretsFile () const
 Returns the pop-server autentication secrets (password) file.
std::string fqdn () const
 Returns the fully-qualified-domain-name override.
std::string nobody () const
 Returns the name of an unprivileged user.
std::string verifier () const
 Returns the path of an external address verifier program.
bool doPolling () const
 Returns true if doing poll-based forwarding.
bool pollingLog () const
 Returns true if polling activity should be logged.
unsigned int pollingTimeout () const
 Returns the timeout for periodic polling.
bool immediate () const
 Returns true if forwarding should occur as soon as each message body is received and before receipt is acknowledged.
bool forwardingOnStore () const
 Returns true if forwarding should occur as each message is stored, after it is acknowledged.
bool forwardingOnDisconnect () const
 Returns true if forwarding should occur when the submitter's network connection disconnects.
bool withTerminate () const
 Returns true if the admin interface should support the terminate command.
std::string scannerAddress () const
 Returns the address of a scanner process.
unsigned int scannerConnectionTimeout () const
 Returns a timeout for connecting to the scanner process.
unsigned int scannerResponseTimeout () const
 Returns a timeout for talking to the scanner process.
bool anonymous () const
 Returns true if the server protocol should be slightly more anonymous.
bool clientTls () const
 Returns true if the client protocol should take account of the server's tls capability.
std::string serverTlsFile () const
 Returns the tls certificate file if the server should support tls.
unsigned int maxSize () const
 Returns the maximum size of submitted messages, or zero.


Detailed Description

An interface for returning application configuration information.

This implementation is minimaly dependent on the command line in order to simplify moving to (eg) the windows registry or a configuration file in the future.

See also:
CommandLine

Definition at line 45 of file configuration.h.


Constructor & Destructor Documentation

Main::Configuration::Configuration ( const CommandLine cl  )  [explicit]

Constructor. The reference is kept.

Definition at line 30 of file configuration.cpp.


Member Function Documentation

unsigned int Main::Configuration::port (  )  const

Returns the main listening port number.

Definition at line 66 of file configuration.cpp.

Referenced by Main::CommandLineImp::semanticError().

G::Strings Main::Configuration::listeningInterfaces (  )  const

Returns the listening interface(s).

Returns a single empty string if no special interfaces are defined.

Definition at line 71 of file configuration.cpp.

References result, and Main::CommandLine::value().

Referenced by firstListeningInterface().

std::string Main::Configuration::firstListeningInterface (  )  const

A convenience method returning the first listeningInterface().

Definition at line 81 of file configuration.cpp.

References listeningInterfaces(), and s.

Referenced by clientInterface(), and Main::Admin::newServer().

std::string Main::Configuration::clientInterface (  )  const

Returns the sending interface.

Definition at line 87 of file configuration.cpp.

References firstListeningInterface().

Referenced by Main::Admin::newServer().

bool Main::Configuration::closeStderr (  )  const

Returns true if stderr should be closed.

Definition at line 98 of file configuration.cpp.

bool Main::Configuration::log (  )  const

Returns true if doing logging.

Definition at line 35 of file configuration.cpp.

Referenced by Main::Run::prepare().

bool Main::Configuration::verbose (  )  const

Returns true if doing verbose logging.

Definition at line 44 of file configuration.cpp.

Referenced by Main::Run::prepare().

bool Main::Configuration::debug (  )  const

Returns true if doing debug-level logging.

Definition at line 49 of file configuration.cpp.

Referenced by Main::Run::prepare().

bool Main::Configuration::useSyslog (  )  const

Returns true if generating syslog events.

Definition at line 54 of file configuration.cpp.

Referenced by Main::Run::prepare().

bool Main::Configuration::logTimestamp (  )  const

Returns true if logging output should be timestamped.

Definition at line 61 of file configuration.cpp.

Referenced by Main::Run::prepare().

bool Main::Configuration::daemon (  )  const

Returns true if running as a daemon.

Definition at line 106 of file configuration.cpp.

Referenced by Main::CommandLineImp::semanticError().

bool Main::Configuration::doForwardingOnStartup (  )  const

Returns true if running as a client.

Definition at line 128 of file configuration.cpp.

bool Main::Configuration::doServing (  )  const

Returns true if running as a server (SMTP, POP, admin or COM).

Definition at line 133 of file configuration.cpp.

bool Main::Configuration::doSmtp (  )  const

Returns true if listening for smtp connections.

Definition at line 188 of file configuration.cpp.

bool Main::Configuration::doPop (  )  const

Returns true if listening for pop connections.

Definition at line 193 of file configuration.cpp.

Referenced by Main::CommandLineImp::semanticError().

bool Main::Configuration::popByName (  )  const

Returns true if the pop spool directory is modified according to the client name.

Definition at line 198 of file configuration.cpp.

bool Main::Configuration::popNoDelete (  )  const

Returns true if pop deletion is to be disabled.

Definition at line 203 of file configuration.cpp.

bool Main::Configuration::doAdmin (  )  const

Returns true if listening for admin connections.

Definition at line 218 of file configuration.cpp.

Referenced by Main::CommandLineImp::semanticError().

unsigned int Main::Configuration::adminPort (  )  const

Returns the admin port number.

Definition at line 93 of file configuration.cpp.

Referenced by Main::Admin::newServer(), and Main::CommandLineImp::semanticError().

unsigned int Main::Configuration::popPort (  )  const

Returns the pop port number.

Definition at line 208 of file configuration.cpp.

Referenced by Main::CommandLineImp::semanticError().

bool Main::Configuration::allowRemoteClients (  )  const

Returns true if allowing remote clients to connect.

Definition at line 213 of file configuration.cpp.

Referenced by Main::Admin::newServer().

G::Path Main::Configuration::spoolDir (  )  const

Returns the spool directory.

Definition at line 111 of file configuration.cpp.

References GSmtp::MessageStore::defaultDirectory().

Referenced by Main::CommandLineImp::semanticError().

std::string Main::Configuration::serverAddress (  )  const

Returns the downstream server's address string.

Definition at line 118 of file configuration.cpp.

Referenced by Main::Admin::newServer().

bool Main::Configuration::usePidFile (  )  const

Returns true if writing a pid file.

Definition at line 223 of file configuration.cpp.

std::string Main::Configuration::pidFile (  )  const

Returns the pid file's path.

Definition at line 228 of file configuration.cpp.

bool Main::Configuration::useFilter (  )  const

Returns true if pre-processing.

Definition at line 233 of file configuration.cpp.

std::string Main::Configuration::filter (  )  const

Returns the path to a server-side pre-processor.

Definition at line 238 of file configuration.cpp.

std::string Main::Configuration::clientFilter (  )  const

Returns the path to a client-side pre-processor.

Definition at line 243 of file configuration.cpp.

unsigned int Main::Configuration::filterTimeout (  )  const

Returns the timeout for executing an ansynchronous filter() or clientFilter() program.

Definition at line 339 of file configuration.cpp.

unsigned int Main::Configuration::icon (  )  const

Returns the icon selector (win32).

Definition at line 248 of file configuration.cpp.

bool Main::Configuration::hidden (  )  const

Returns true if the main window is hidden (win32).

Definition at line 254 of file configuration.cpp.

unsigned int Main::Configuration::responseTimeout (  )  const

Returns the client-side protocol timeout value.

Definition at line 284 of file configuration.cpp.

unsigned int Main::Configuration::connectionTimeout (  )  const

Returns the client-side connection timeout value.

Definition at line 289 of file configuration.cpp.

Referenced by Main::Admin::newServer().

unsigned int Main::Configuration::promptTimeout (  )  const

Returns the timeout for getting a prompt from the SMTP server.

Definition at line 183 of file configuration.cpp.

std::string Main::Configuration::clientSecretsFile (  )  const

Returns the client-side autentication secrets (password) file.

Returns the empty string if none.

Definition at line 259 of file configuration.cpp.

Referenced by Main::CommandLineImp::semanticError().

std::string Main::Configuration::serverSecretsFile (  )  const

Returns the server-side autentication secrets (password) file.

Returns the empty string if none.

Definition at line 279 of file configuration.cpp.

Referenced by Main::CommandLineImp::semanticError().

std::string Main::Configuration::popSecretsFile (  )  const

Returns the pop-server autentication secrets (password) file.

Returns the empty string if not defined.

Definition at line 274 of file configuration.cpp.

References GPop::Secrets::defaultPath().

Referenced by Main::CommandLineImp::semanticError().

std::string Main::Configuration::fqdn (  )  const

Returns the fully-qualified-domain-name override.

Definition at line 294 of file configuration.cpp.

std::string Main::Configuration::nobody (  )  const

Returns the name of an unprivileged user.

This is only used if running with a real user-id of root.

Definition at line 299 of file configuration.cpp.

std::string Main::Configuration::verifier (  )  const

Returns the path of an external address verifier program.

Definition at line 304 of file configuration.cpp.

bool Main::Configuration::doPolling (  )  const

Returns true if doing poll-based forwarding.

Definition at line 145 of file configuration.cpp.

References pollingTimeout().

Referenced by pollingLog().

bool Main::Configuration::pollingLog (  )  const

Returns true if polling activity should be logged.

Definition at line 155 of file configuration.cpp.

References doPolling(), and pollingTimeout().

unsigned int Main::Configuration::pollingTimeout (  )  const

Returns the timeout for periodic polling.

Definition at line 150 of file configuration.cpp.

Referenced by doPolling(), forwardingOnDisconnect(), and pollingLog().

bool Main::Configuration::immediate (  )  const

Returns true if forwarding should occur as soon as each message body is received and before receipt is acknowledged.

Definition at line 138 of file configuration.cpp.

bool Main::Configuration::forwardingOnStore (  )  const

Returns true if forwarding should occur as each message is stored, after it is acknowledged.

(This will result in a complete client session per message.)

Definition at line 161 of file configuration.cpp.

bool Main::Configuration::forwardingOnDisconnect (  )  const

Returns true if forwarding should occur when the submitter's network connection disconnects.

Definition at line 168 of file configuration.cpp.

References pollingTimeout().

bool Main::Configuration::withTerminate (  )  const

Returns true if the admin interface should support the terminate command.

Definition at line 309 of file configuration.cpp.

Referenced by Main::Admin::newServer(), and Main::CommandLineImp::semanticError().

std::string Main::Configuration::scannerAddress (  )  const

Returns the address of a scanner process.

Definition at line 319 of file configuration.cpp.

unsigned int Main::Configuration::scannerConnectionTimeout (  )  const

Returns a timeout for connecting to the scanner process.

Definition at line 324 of file configuration.cpp.

unsigned int Main::Configuration::scannerResponseTimeout (  )  const

Returns a timeout for talking to the scanner process.

Definition at line 329 of file configuration.cpp.

bool Main::Configuration::anonymous (  )  const

Returns true if the server protocol should be slightly more anonymous.

Definition at line 334 of file configuration.cpp.

bool Main::Configuration::clientTls (  )  const

Returns true if the client protocol should take account of the server's tls capability.

Definition at line 264 of file configuration.cpp.

std::string Main::Configuration::serverTlsFile (  )  const

Returns the tls certificate file if the server should support tls.

Definition at line 269 of file configuration.cpp.

unsigned int Main::Configuration::maxSize (  )  const

Returns the maximum size of submitted messages, or zero.

Definition at line 314 of file configuration.cpp.


The documentation for this class was generated from the following files:

Generated on Fri Apr 18 15:56:14 2008 for E-MailRelay by  doxygen 1.5.5