Update config generation
This commit is contained in:
parent
d7e2aee3a3
commit
b05c4ad5d9
4 changed files with 129 additions and 130 deletions
|
|
@ -1,52 +0,0 @@
|
|||
/**
|
||||
* hermes antispam proxy
|
||||
* Copyright (C) 2006, 2007 Juan José Gutiérrez de Quevedo <juanjo@gutierrezdequevedo.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* @author Juan José Gutiérrez de Quevedo <juanjo@gutierrezdequevedo.com>
|
||||
*/
|
||||
#ifndef CONFIGFILE_H
|
||||
#define CONFIGFILE_H
|
||||
|
||||
#include "hermes.h"
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Configfile
|
||||
{
|
||||
private:
|
||||
static string parseAsString(string);
|
||||
static bool parseAsBool(string);
|
||||
static long parseAsInt(string);
|
||||
static list<string> parseAsList(string);
|
||||
int uid;
|
||||
int gid;
|
||||
%templ_privateattribs%
|
||||
public:
|
||||
Configfile();
|
||||
void parse(string);
|
||||
void validateConfig();
|
||||
int getUid();
|
||||
int getGid();
|
||||
%templ_publicmethods%
|
||||
};
|
||||
|
||||
#endif //CONFIGFILE_H
|
||||
|
|
@ -9,7 +9,6 @@
|
|||
*
|
||||
|
||||
*clean*
|
||||
#ifndef WIN32
|
||||
|
||||
* whether to fork to the background. initscripts require
|
||||
* this to be true most of the time.
|
||||
|
|
@ -35,7 +34,6 @@ string,group,"nobody"
|
|||
* if you set background=true above, this will write the pid
|
||||
* of the forked hermes, not the original.
|
||||
string,pid_file,"/var/run/hermes.pid"
|
||||
#endif //WIN32
|
||||
|
||||
* the port where hermes will listen for new connection.
|
||||
* if you are going to use a port lower than 1024 (almost always,
|
||||
|
|
@ -58,11 +56,7 @@ int,server_port,2525
|
|||
* database file to use.
|
||||
* if you are chrooting, the path is relative to the chroot:
|
||||
* real filepath = chroot + database_file
|
||||
#ifdef WIN32
|
||||
string,database_file,"greylisting.db"
|
||||
#else
|
||||
string,database_file,"/var/hermes/greylisting.db"
|
||||
#endif //WIN32
|
||||
|
||||
* whether to use greylisting.
|
||||
* greylisting will slightly delay your emails (configurable, see below)
|
||||
|
|
@ -120,13 +114,6 @@ bool,add_status_header,false
|
|||
* time to delay the initial SMTP banner
|
||||
int,banner_delay_time,5
|
||||
|
||||
#ifdef REALLY_VERBOSE_DEBUG
|
||||
* email to notify exceptions to.
|
||||
* CAVEAT: the code that does this is VERY BUGGY and VERY VERBOSE, don't use unless you
|
||||
* are a developer looking for a bug.
|
||||
string,notify_to,""
|
||||
#endif //REALLY_VERBOSE_DEBUG
|
||||
|
||||
* greylisting options.
|
||||
*
|
||||
*clean*
|
||||
|
|
@ -142,56 +129,12 @@ int,initial_blacklist,5
|
|||
* 36 is a magic number, is the maximum days between a day and the same day next month
|
||||
int,whitelist_expiry,36
|
||||
|
||||
* whether to submit stats.
|
||||
bool,submit_stats,true
|
||||
|
||||
* should stats be submited using SSL?
|
||||
* recomended, but some people will compile without ssl.
|
||||
#ifdef HAVE_SSL
|
||||
bool,submit_stats_ssl,true
|
||||
#else
|
||||
bool,submit_stats_ssl,false
|
||||
#endif //HAVE_SSL
|
||||
|
||||
* username (used to submit stats).
|
||||
* you can register on http://www.hermes-project.com
|
||||
string,submit_stats_username,"anonymous"
|
||||
|
||||
* password
|
||||
string,submit_stats_password,"anonymous"
|
||||
|
||||
* log level:
|
||||
* 0: log only errors
|
||||
* 1: log errors and information (default)
|
||||
* 2: debug (passwords might be written in plaintext with this option, so use with care)
|
||||
int,log_level,1
|
||||
|
||||
#if LOGGER_CLASS==FileLogger
|
||||
* if you are using the filelogger, which file to log to.
|
||||
string,file_logger_filename,"hermes.log"
|
||||
|
||||
* whether to keep the logger file locked between writes
|
||||
bool,keep_file_locked,true
|
||||
|
||||
* frequency for log rotating in minutes
|
||||
* default is 1440 (1 day)
|
||||
* 0 means no rotation
|
||||
int,log_rotation_frequency,1440
|
||||
|
||||
* format for the logfile rotation
|
||||
* if you are using logfile rotation, file_logger represents the filename
|
||||
* to which the logger will write, while this is the name files will get
|
||||
* when rotated
|
||||
* you can use the following variables:
|
||||
* %%year%% - current year (4 digits)
|
||||
* %%month%% - current month
|
||||
* %%day%% - current day
|
||||
* %%hour%% - current hour
|
||||
* %%minute%% - current minute
|
||||
* all of them are zero-padded
|
||||
string,rotate_filename,"hermes-%%year%%-%%month%%-%%day%%-%%hour%%:%%minute%%.log"
|
||||
#endif //LOGGER_CLASS==FileLogger
|
||||
|
||||
* whether to clean the database file and send stats.
|
||||
* if you have two instances of hermes running (for example one for smtp and other for smtps)
|
||||
* you want to configure all of them but one to use clean_db=false.
|
||||
|
|
@ -201,9 +144,7 @@ string,rotate_filename,"hermes-%%year%%-%%month%%-%%day%%-%%hour%%:%%minute%%.lo
|
|||
* will be left hanging around without any use.
|
||||
bool,clean_db,true
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
* ssl-related config options
|
||||
* NOTE: this NEEDS the openssl library
|
||||
*
|
||||
*clean*
|
||||
|
||||
|
|
@ -235,7 +176,6 @@ string,certificate_file,"/etc/hermes/hermes.cert"
|
|||
* # openssl dhparam -out dhparam.pem <numbits>
|
||||
* (replace <numbits> with the number of bits suitable for you, e.G. 1024)
|
||||
string,dhparams_file,""
|
||||
#endif //HAVE_SSL
|
||||
|
||||
* whether to add headers to the email sent or no.
|
||||
* to be rfc compatible this HAS to be true, but if you set to false, no one will know you are using hermes
|
||||
|
|
@ -262,11 +202,7 @@ bool,check_helo_against_reverse,false
|
|||
|
||||
* whether to query the spf record for the incoming domain.
|
||||
* should help, enable if you have libspf (if you don't, install it and recompile)
|
||||
#ifdef HAVE_SPF
|
||||
bool,query_spf,true
|
||||
#else
|
||||
bool,query_spf,false
|
||||
#endif //HAVE_SPF
|
||||
|
||||
* return temporary error instead of permanent error.
|
||||
* Currently, this only applies to SPF and DNSBL rejected email
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue