- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Main::Configuration Class Reference

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

`#include <configuration.h>`

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

## 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 31 of file configuration.cpp.

## Member Function Documentation

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

Returns the admin port number.

Definition at line 120 of file configuration.cpp.

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

bool Main::Configuration::allowRemoteClients | ( |  | ) | const

Returns true if allowing remote clients to connect.

Definition at line 239 of file configuration.cpp.

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

bool Main::Configuration::anonymous | ( |  | ) | const

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

Definition at line 374 of file configuration.cpp.

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

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

Definition at line 269 of file configuration.cpp.

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

Returns the sending interface.

Definition at line 98 of file configuration.cpp.

References G::Str::tail().

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

bool Main::Configuration::clientOverTls | ( |  | ) | const

Returns true if using the SMTP over TLS (vs.

negotiated TLS using STARTTLS).

Definition at line 294 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 284 of file configuration.cpp.

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

bool Main::Configuration::clientTls | ( |  | ) | const

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

Definition at line 289 of file configuration.cpp.

bool Main::Configuration::closeStderr | ( |  | ) | const

Returns true if stderr should be closed.

Definition at line 125 of file configuration.cpp.

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

Returns the client-side connection timeout value.

Definition at line 324 of file configuration.cpp.

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

bool Main::Configuration::daemon | ( |  | ) | const

Returns true if running as a daemon.

Definition at line 133 of file configuration.cpp.

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

bool Main::Configuration::debug | ( |  | ) | const

Returns true if doing debug-level logging.

Definition at line 50 of file configuration.cpp.

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

bool Main::Configuration::doAdmin | ( |  | ) | const

Returns true if listening for admin connections.

Definition at line 244 of file configuration.cpp.

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

bool Main::Configuration::doForwardingOnStartup | ( |  | ) | const

Returns true if running as a client.

Definition at line 155 of file configuration.cpp.

bool Main::Configuration::doPolling | ( |  | ) | const

Returns true if doing poll-based forwarding.

Definition at line 170 of file configuration.cpp.

bool Main::Configuration::doPop | ( |  | ) | const

Returns true if listening for pop connections.

Definition at line 219 of file configuration.cpp.

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

bool Main::Configuration::doServing | ( |  | ) | const

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

Definition at line 160 of file configuration.cpp.

bool Main::Configuration::doSmtp | ( |  | ) | const

Returns true if listening for smtp connections.

Definition at line 214 of file configuration.cpp.

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

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

Definition at line 264 of file configuration.cpp.

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

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

Definition at line 379 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 193 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 186 of file configuration.cpp.

std::string Main::Configuration::fqdn | ( | std::string | default_ = `std::string()` | ) | const

Returns the fully-qualified-domain-name override.

Definition at line 334 of file configuration.cpp.

bool Main::Configuration::hidden | ( |  | ) | const

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

Definition at line 279 of file configuration.cpp.

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

Returns the icon selector (win32).

Definition at line 274 of file configuration.cpp.

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 165 of file configuration.cpp.

G::Strings Main::Configuration::listeningInterfaces | ( | const std::string & | protocol = `std::string()` | ) | const

Returns the listening interface(s).

Definition at line 77 of file configuration.cpp.

References G::Str::head(), and G::Str::tail().

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

bool Main::Configuration::log | ( |  | ) | const

Returns true if doing logging.

Definition at line 36 of file configuration.cpp.

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

std::string Main::Configuration::logFile | ( |  | ) | const

Returns the path of a stderr replacement for logging.

Definition at line 67 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 62 of file configuration.cpp.

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

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

Returns the maximum size of submitted messages, or zero.

Definition at line 354 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 339 of file configuration.cpp.

bool Main::Configuration::peerLookup | ( |  | ) | const

Returns true if there should be some attempt to look up the userid of SMTP peers connected from the the local machine.

Definition at line 384 of file configuration.cpp.

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

Returns the pid file's path.

Definition at line 254 of file configuration.cpp.

bool Main::Configuration::pollingLog | ( |  | ) | const

Returns true if polling activity should be logged.

Definition at line 180 of file configuration.cpp.

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

Returns the timeout for periodic polling.

Definition at line 175 of file configuration.cpp.

bool Main::Configuration::popByName | ( |  | ) | const

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

Definition at line 224 of file configuration.cpp.

bool Main::Configuration::popNoDelete | ( |  | ) | const

Returns true if pop deletion is to be disabled.

Definition at line 229 of file configuration.cpp.

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

Returns the pop port number.

Definition at line 234 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 309 of file configuration.cpp.

References GPop::Secrets::defaultPath().

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

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

Returns the main listening port number.

Definition at line 72 of file configuration.cpp.

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

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

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

Definition at line 209 of file configuration.cpp.

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

Returns the client-side protocol timeout value.

Definition at line 319 of file configuration.cpp.

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

Returns the address of a scanner process.

Definition at line 359 of file configuration.cpp.

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

Returns a timeout for connecting to the scanner process.

Definition at line 364 of file configuration.cpp.

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

Returns a timeout for talking to the scanner process.

Definition at line 369 of file configuration.cpp.

unsigned int Main::Configuration::secureConnectionTimeout | ( |  | ) | const

Returns the timeout for establishing a secure connection.

Definition at line 329 of file configuration.cpp.

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

Returns the downstream server's address string.

Definition at line 145 of file configuration.cpp.

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

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

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

Returns the empty string if none.

Definition at line 314 of file configuration.cpp.

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

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

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

Definition at line 304 of file configuration.cpp.

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

Returns the spool directory.

Definition at line 138 of file configuration.cpp.

References GSmtp::MessageStore::defaultDirectory().

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

unsigned int Main::Configuration::tlsConfig | ( |  | ) | const

Returns TLS configuration flags.

Definition at line 299 of file configuration.cpp.

bool Main::Configuration::useFilter | ( |  | ) | const

Returns true if pre-processing.

Definition at line 259 of file configuration.cpp.

bool Main::Configuration::usePidFile | ( |  | ) | const

Returns true if writing a pid file.

Definition at line 249 of file configuration.cpp.

bool Main::Configuration::useSyslog | ( |  | ) | const

Returns true if generating syslog events.

Definition at line 55 of file configuration.cpp.

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

bool Main::Configuration::verbose | ( |  | ) | const

Returns true if doing verbose logging.

Definition at line 45 of file configuration.cpp.

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

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

Returns the path of an external address verifier program.

Definition at line 344 of file configuration.cpp.

bool Main::Configuration::withTerminate | ( |  | ) | const

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

Definition at line 349 of file configuration.cpp.

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

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

- configuration.h
- configuration.cpp