diff options
-rw-r--r-- | common/smtppass.c | 21 | ||||
-rw-r--r-- | src/clamsmtpd.c | 22 |
2 files changed, 33 insertions, 10 deletions
diff --git a/common/smtppass.c b/common/smtppass.c index 2e590f6..0038d9e 100644 --- a/common/smtppass.c +++ b/common/smtppass.c @@ -36,7 +36,6 @@ * Andreas Steinmetz <ast@domdv.de> */ -/* TODO: Remove unneeded headers */ #include <sys/time.h> #include <sys/types.h> #include <sys/socket.h> @@ -119,6 +118,21 @@ spthread_t; #define OK_RSP "250" #define START_RSP "220" +/* The set of delimiters that can be present between config and value */ +#define CFG_DELIMS ": \t" + +#define LINE_TOO_LONG(ctx) ((ctx)->linelen >= (SP_LINE_LENGTH - 2)) + +/* ----------------------------------------------------------------------- + * CONFIGURATION OPTIONS + * + * - Be sure that your configuration option needs to go into this + * file. More likely it'll go into clamsmtpd.c + * - When adding configuration options follow the instructions in + * clamsmtpd.c, except add option to spstate_t (above) and parse in + * sp_parse_option (below) + */ + #define CFG_MAXTHREADS "MaxConnections" #define CFG_TIMEOUT "TimeOut" #define CFG_OUTADDR "OutAddress" @@ -126,11 +140,6 @@ spthread_t; #define CFG_TRANSPARENT "TransparentProxy" #define CFG_DIRECTORY "TempDirectory" -/* The set of delimiters that can be present between config and value */ -#define CFG_DELIMS ": \t" - - -#define LINE_TOO_LONG(ctx) ((ctx)->linelen >= (SP_LINE_LENGTH - 2)) /* ----------------------------------------------------------------------- * DEFAULT SETTINGS diff --git a/src/clamsmtpd.c b/src/clamsmtpd.c index 9f35165..1d10adf 100644 --- a/src/clamsmtpd.c +++ b/src/clamsmtpd.c @@ -99,6 +99,23 @@ clctx_t; #define CLAM_DISCONNECT "END\n" #define DEFAULT_CONFIG CONF_PREFIX "/clamsmtpd.conf" +#define DEFAULT_CLAMAV "/var/run/clamav/clamd" +#define DEFAULT_HEADER "X-Virus-Scanned: ClamAV using ClamSMTP" + +/* ----------------------------------------------------------------------- + * CONFIGURATION OPTIONS + * + * - Be sure your option is relevant to this file. Certain options + * should go into smtppass.c + * - Add field to clstate_t structure (above) + * - Add default (above) and set in main (below). Required options + * are difficult to implement under the current structure. It's + * better to have a sane default. + * - Add config keyword (below) + * - Parsing and validation of option in cb_parse_option (below) + * - Document in the sample doc/clamsmtpd.conf + * - Document in doc/clamsmtpd.conf.5 + */ #define CFG_CLAMADDR "ClamAddress" #define CFG_HEADER "ScanHeader" @@ -107,9 +124,6 @@ clctx_t; #define CFG_QUARANTINE "Quarantine" #define CFG_DEBUGFILES "DebugFiles" -#define DEFAULT_CLAMAV "/var/run/clamav/clamd" -#define DEFAULT_HEADER "X-Virus-Scanned: ClamAV using ClamSMTP" - /* ----------------------------------------------------------------------- * GLOBALS */ @@ -144,7 +158,7 @@ int main(int argc, char* argv[]) int r; char* t; - /* Setup some defaults */ + /* Configuration defaults */ memset(&g_clstate, 0, sizeof(g_clstate)); g_clstate.header = DEFAULT_HEADER; g_clstate.directory = _PATH_TMP; |