smf_settings.h File Reference

Defines SMFSettings_T and config file parsing functions. More...

#include "spmfilter_config.h"
#include "smf_dict.h"
#include "smf_list.h"
Include dependency graph for smf_settings.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SMFSettings_T
 Holds spmfilter runtime configuration. More...
 

Enumerations

enum  SMFTlsOption_T { SMF_TLS_DISABLED, SMF_TLS_ENABLED, SMF_TLS_REQUIRED }
 Possible types of TLS configuration. More...
 
enum  SMFConnectionType_T { SMF_SQL_CONN, SMF_LDAP_CONN }
 Possible backend connection types. More...
 

Functions

int smf_settings_set_debug (SMFSettings_T *settings, int debug)
 Set debug setting.
 
int smf_settings_get_debug (SMFSettings_T *settings)
 Get debug setting.
 
int smf_settings_set_config_file (SMFSettings_T *settings, char *cf)
 Set path to config file.
 
char * smf_settings_get_config_file (SMFSettings_T *settings)
 Get config file path.
 
int smf_settings_set_queue_dir (SMFSettings_T *settings, char *qd)
 Set path to queue directory.
 
char * smf_settings_get_queue_dir (SMFSettings_T *settings)
 Get queue directory path.
 
void smf_settings_set_engine (SMFSettings_T *settings, char *engine)
 Set engine which should be used.
 
char * smf_settings_get_engine (SMFSettings_T *settings)
 Get configured engine.
 
int smf_settings_add_module (SMFSettings_T *settings, char *module)
 Add available module to module list, which will be loaded at runtime.
 
SMFList_Tsmf_settings_get_modules (SMFSettings_T *settings)
 Get available modules.
 
void smf_settings_set_module_fail (SMFSettings_T *settings, int i)
 Set module_fail setting 1 = proceed and ignore 2 = cancel further processing and return permanet error 3 = cancel further processing and return temporary error (default)
 
int smf_settings_get_module_fail (SMFSettings_T *settings)
 Get module_fail setting.
 
void smf_settings_set_nexthop (SMFSettings_T *settings, char *nexthop)
 Set nexthop setting. This parameter specifies the final destination, after a mail is processed by spmfilter.
 
char * smf_settings_get_nexthop (SMFSettings_T *settings)
 Get configured nexthop setting.
 
void smf_settings_set_nexthop_fail_code (SMFSettings_T *settings, int i)
 Set nexthop_fail_code setting If the delivery to the final destination fails for any reason, this code is used as response to the sending MTA (default 451).
 
int smf_settings_get_nexthop_fail_code (SMFSettings_T *settings)
 Get nexthop_fail_code setting.
 
void smf_settings_set_nexthop_fail_msg (SMFSettings_T *settings, char *msg)
 Set nexthop_fail_msg setting. If the delivery to the final destination fails for any reason, this message is used as reponse for the sending MTA. (default "Requested action aborted: local error in processing").
 
char * smf_settings_get_nexthop_fail_msg (SMFSettings_T *settings)
 Get nexthop_fail_msg setting.
 
void smf_settings_set_backend (SMFSettings_T *settings, char *backend)
 Set lookup backend.
 
char * smf_settings_get_backend (SMFSettings_T *settings)
 Get backend setting.
 
void smf_settings_set_backend_connection (SMFSettings_T *settings, char *conn)
 Set backend_connection setting. If there are multiple server configured in the specified backend, it's possible to define a failover or load-balancing behaviour. Possible values are: balance = when you configure the backend profile for load balancing, spmfilter distributes connections across the list of hosts. If the actual host is not reachable, spmfilter switches back to failover configuration. failover = when you configure the backend profile for failover, spmfilter fails over to the next host in the list if it cannot connect to the first host.
 
char * smf_settings_get_backend_connection (SMFSettings_T *settings)
 Get backend connection setting.
 
void smf_settings_set_add_header (SMFSettings_T *settings, int i)
 Define if spmfilter should add it's own header.
 
int smf_settings_get_add_header (SMFSettings_T *settings)
 Get add_header setting.
 
void smf_settings_set_max_size (SMFSettings_T *settings, unsigned long size)
 Set max. allowed message size in byte.
 
unsigned long smf_settings_get_max_size (SMFSettings_T *settings)
 Get max_size setting in bytes.
 
void smf_settings_set_tls (SMFSettings_T *settings, SMFTlsOption_T t)
 Set tls setting.
 
SMFTlsOption_T smf_settings_get_tls (SMFSettings_T *settings)
 Get tls setting.
 
void smf_settings_set_lib_dir (SMFSettings_T *settings, char *lib_dir)
 Set path to shared libraries, if needed.
 
char * smf_settings_get_lib_dir (SMFSettings_T *settings)
 Get shared library folder.
 
void smf_settings_set_pid_file (SMFSettings_T *settings, char *pid_file)
 Set pid file.
 
char * smf_settings_get_pid_file (SMFSettings_T *settings)
 Get current pid file.
 
void smf_settings_set_bind_ip (SMFSettings_T *settings, char *ip)
 Set bind ip.
 
char * smf_settings_get_bind_ip (SMFSettings_T *settings)
 Get current bind ip.
 
void smf_settings_set_bind_port (SMFSettings_T *settings, int port)
 Set bind port.
 
int smf_settings_get_bind_port (SMFSettings_T *settings)
 Get current bind port.
 
void smf_settings_set_listen_backlog (SMFSettings_T *settings, int backlog)
 Set listen backlog.
 
int smf_settings_get_listen_backlog (SMFSettings_T *settings)
 Get listen backlog number.
 
void smf_settings_set_foreground (SMFSettings_T *settings, int foreground)
 Set foreground config option.
 
int smf_settings_get_foreground (SMFSettings_T *settings)
 Get foreground setting.
 
void smf_settings_set_user (SMFSettings_T *settings, char *user)
 Set effective user.
 
char * smf_settings_get_user (SMFSettings_T *settings)
 Get effective user.
 
void smf_settings_set_group (SMFSettings_T *settings, char *group)
 Set effective group.
 
char * smf_settings_get_group (SMFSettings_T *settings)
 Get effective group.
 
void smf_settings_set_max_childs (SMFSettings_T *settings, int max_childs)
 Set the number of maximal allowed processes.
 
int smf_settings_get_max_childs (SMFSettings_T *settings)
 Get number of maxmimal allowed processes.
 
void smf_settings_set_spare_childs (SMFSettings_T *settings, int spare_childs)
 Set the number of spare child processes.
 
int smf_settings_get_spare_childs (SMFSettings_T *settings)
 Get number of spare processes.
 
void smf_settings_set_syslog_facility (SMFSettings_T *settings, char *facility)
 Set syslog facility.
 
int smf_settings_get_syslog_facility (SMFSettings_T *settings)
 Get syslog facility.
 
int smf_settings_set_smtp_code (SMFSettings_T *settings, int code, char *msg)
 Add smtp return code to list.
 
char * smf_settings_get_smtp_code (SMFSettings_T *settings, int code)
 Get smtp return code message of given code.
 
void smf_settings_set_smtpd_timeout (SMFSettings_T *settings, int timeout)
 Set time limit for receiving a remote SMTP client request.
 
int smf_settings_get_smtpd_timeout (SMFSettings_T *settings)
 Get time limit for receiving a remote SMTP client request.
 
void smf_settings_set_sql_driver (SMFSettings_T *settings, char *driver)
 Set SQL driver, which should be used. Possible values are:
 
char * smf_settings_get_sql_driver (SMFSettings_T *settings)
 Get sql_driver setting.
 
void smf_settings_set_sql_name (SMFSettings_T *settings, char *name)
 Set SQL database name.
 
char * smf_settings_get_sql_name (SMFSettings_T *settings)
 Get SQL database name.
 
int smf_settings_add_sql_host (SMFSettings_T *settings, char *host)
 Set SQL host(s)
 
SMFList_Tsmf_settings_get_sql_hosts (SMFSettings_T *settings)
 Get SQL host(s)
 
void smf_settings_set_sql_port (SMFSettings_T *settings, int port)
 Set SQL port.
 
int smf_settings_get_sql_port (SMFSettings_T *settings)
 Get SQL port.
 
void smf_settings_set_sql_user (SMFSettings_T *settings, char *user)
 Set SQL username.
 
char * smf_settings_get_sql_user (SMFSettings_T *settings)
 Get SQL username.
 
void smf_settings_set_sql_pass (SMFSettings_T *settings, char *pass)
 Set SQL password.
 
char * smf_settings_get_sql_pass (SMFSettings_T *settings)
 Get SQL password.
 
void smf_settings_set_sql_user_query (SMFSettings_T *settings, char *query)
 Set sql_user_query setting.
 
char * smf_settings_get_sql_user_query (SMFSettings_T *settings)
 Get sql_user_query setting.
 
void smf_settings_set_sql_encoding (SMFSettings_T *settings, char *encoding)
 Set SQL encoding.
 
char * smf_settings_get_sql_encoding (SMFSettings_T *settings)
 Get SQL encoding.
 
void smf_settings_set_sql_max_connections (SMFSettings_T *settings, int i)
 Set max. number of SQL connections.
 
int smf_settings_get_sql_max_connections (SMFSettings_T *settings)
 Get max. number of SQL connections.
 
void smf_settings_set_ldap_uri (SMFSettings_T *settings, char *uri)
 Set LDAP uri.
 
char * smf_settings_get_ldap_uri (SMFSettings_T *settings)
 Get LDAP uri.
 
int smf_settings_add_ldap_host (SMFSettings_T *settings, char *host)
 Set LDAP host(s)
 
SMFList_Tsmf_settings_get_ldap_hosts (SMFSettings_T *settings)
 Get LDAP host(s)
 
void smf_settings_set_ldap_port (SMFSettings_T *settings, int port)
 Set LDAP port.
 
int smf_settings_get_ldap_port (SMFSettings_T *settings)
 Get LDAP port.
 
void smf_settings_set_ldap_binddn (SMFSettings_T *settings, char *binddn)
 Set LDAP binddn.
 
char * smf_settings_get_ldap_binddn (SMFSettings_T *settings)
 Get LDAP binddn.
 
void smf_settings_set_ldap_bindpw (SMFSettings_T *settings, char *bindpw)
 Set LDAP bind password.
 
char * smf_settings_get_ldap_bindpw (SMFSettings_T *settings)
 Get LDAP bind password.
 
void smf_settings_set_ldap_base (SMFSettings_T *settings, char *base)
 Set LDAP search base.
 
char * smf_settings_get_ldap_base (SMFSettings_T *settings)
 Get LDAP search base.
 
void smf_settings_set_ldap_referrals (SMFSettings_T *settings, int i)
 Set ldap_referrals setting.
 
int smf_settings_get_ldap_referrals (SMFSettings_T *settings)
 Get ldap_referrals setting.
 
void smf_settings_set_ldap_scope (SMFSettings_T *settings, char *scope)
 Set LDAP scope Possible values are:
 
char * smf_settings_get_ldap_scope (SMFSettings_T *settings)
 Get LDAP scope.
 
void smf_settings_set_ldap_user_query (SMFSettings_T *settings, char *query)
 Set LDAP user query.
 
char * smf_settings_get_ldap_user_query (SMFSettings_T *settings)
 Get LDAP user query.
 
void smf_settings_set_lookup_persistent (SMFSettings_T *settings, int persistent)
 Set lookup connection persistent.
 
int smf_settings_get_lookup_persistent (SMFSettings_T *settings)
 Get the lookup persistent value.
 
char * smf_settings_group_get (SMFSettings_T *settings, char *group_name, char *key)
 Returns the raw value associated with key under the selected group.
 
int smf_settings_group_get_integer (SMFSettings_T *settings, char *group_name, char *key)
 Returns the value associated with key under the selected group as an integer.
 
int smf_settings_group_get_boolean (SMFSettings_T *settings, char *group_name, char *key)
 Returns the boolean values associated with key under the selected group as integer.
 
SMFList_Tsmf_settings_group_get_list (SMFSettings_T *settings, char *group_name, char *key)
 Returns the values associated with key under the selected group.
 

Detailed Description

Defines SMFSettings_T and config file parsing functions.

All config settings, defined in spmfilter.conf, are stored in a SMFSettings_T object and can be accessed via the corresponding function.

Enumeration Type Documentation

Possible backend connection types.

Enumerator
SMF_SQL_CONN 

SQL connection

SMF_LDAP_CONN 

LDAP connection

Possible types of TLS configuration.

Enumerator
SMF_TLS_DISABLED 

TLS is disabled

SMF_TLS_ENABLED 

TLS is enabled

SMF_TLS_REQUIRED 

TLS is enabled and required

Function Documentation

int smf_settings_add_ldap_host ( SMFSettings_T settings,
char *  host 
)

Set LDAP host(s)

Parameters
settingsa SMFSettings_T object
hostldap host list
Returns
0 on success or -1 in case of error
int smf_settings_add_module ( SMFSettings_T settings,
char *  module 
)

Add available module to module list, which will be loaded at runtime.

Parameters
settingsa SMFSettings_T object
modulemodule name
Returns
0 on success or -1 in case of error
int smf_settings_add_sql_host ( SMFSettings_T settings,
char *  host 
)

Set SQL host(s)

Parameters
settingsa SMFSettings_T object
hostsql_host list
Returns
0 on success or -1 in case of error
int smf_settings_get_add_header ( SMFSettings_T settings)

Get add_header setting.

Parameters
settingsa SMFSettings_T object
Returns
add_header value
char* smf_settings_get_backend ( SMFSettings_T settings)

Get backend setting.

Parameters
settingsa SMFSettings_T object
Returns
backend setting
char* smf_settings_get_backend_connection ( SMFSettings_T settings)

Get backend connection setting.

Parameters
settingsa SMFSettings_T object
Returns
backend connection
char* smf_settings_get_bind_ip ( SMFSettings_T settings)

Get current bind ip.

Parameters
settingsa SMFSettings_T object
Returns
char pointer with ip
int smf_settings_get_bind_port ( SMFSettings_T settings)

Get current bind port.

Parameters
settingsa SMFSettings_T object
Returns
port number
char* smf_settings_get_config_file ( SMFSettings_T settings)

Get config file path.

Parameters
settingsa SMFSettings_T object
Returns
config file path
int smf_settings_get_debug ( SMFSettings_T settings)

Get debug setting.

Parameters
settingsa SMFSettings_T object
Returns
debug setting
char* smf_settings_get_engine ( SMFSettings_T settings)

Get configured engine.

Parameters
settingsa SMFSettings_T object
Returns
engine
int smf_settings_get_foreground ( SMFSettings_T settings)

Get foreground setting.

Parameters
settingsa SMFSettings_T object
Returns
foreground setting
char* smf_settings_get_group ( SMFSettings_T settings)

Get effective group.

Parameters
settingsa SMFSettings_T object
Returns
char pointer with groupname
char* smf_settings_get_ldap_base ( SMFSettings_T settings)

Get LDAP search base.

Parameters
settingsa SMFSettings_T object
Returns
ldap base value
char* smf_settings_get_ldap_binddn ( SMFSettings_T settings)

Get LDAP binddn.

Parameters
settingsa SMFSettings_T object
Returns
ldap binddn value
char* smf_settings_get_ldap_bindpw ( SMFSettings_T settings)

Get LDAP bind password.

Parameters
settingsa SMFSettings_T object
Returns
ldap_bindpw value
SMFList_T* smf_settings_get_ldap_hosts ( SMFSettings_T settings)

Get LDAP host(s)

Parameters
settingsa SMFSettings_T object
Returns
ldap host list
int smf_settings_get_ldap_port ( SMFSettings_T settings)

Get LDAP port.

Parameters
settingsa SMFSettings_T object
Returns
ldap_port value
int smf_settings_get_ldap_referrals ( SMFSettings_T settings)

Get ldap_referrals setting.

Parameters
settingsa SMFSettings_T object
Returns
ldap referrals value
char* smf_settings_get_ldap_scope ( SMFSettings_T settings)

Get LDAP scope.

Parameters
settingsa SMFSettings_T object
Returns
ldap scope
char* smf_settings_get_ldap_uri ( SMFSettings_T settings)

Get LDAP uri.

Parameters
settingsa SMFSettings_T object
Returns
ldap uri value
char* smf_settings_get_ldap_user_query ( SMFSettings_T settings)

Get LDAP user query.

Parameters
settingsa SMFSettings_T object
Returns
ldap user_query
char* smf_settings_get_lib_dir ( SMFSettings_T settings)

Get shared library folder.

Parameters
settingsa SMFSettings_T object
Returns
shared library folder
int smf_settings_get_listen_backlog ( SMFSettings_T settings)

Get listen backlog number.

Parameters
settingsa SMFSettings_T object
Returns
listen backlog number
int smf_settings_get_lookup_persistent ( SMFSettings_T settings)

Get the lookup persistent value.

Parameters
settingsa SMFSettings_T object
Returns
persistent value as integer, 1 if true, 0 if false
int smf_settings_get_max_childs ( SMFSettings_T settings)

Get number of maxmimal allowed processes.

Parameters
settingsa SMFSettings_T object
Returns
number of processes
unsigned long smf_settings_get_max_size ( SMFSettings_T settings)

Get max_size setting in bytes.

Parameters
settingsa SMFSettings_T object
Returns
max_size value
int smf_settings_get_module_fail ( SMFSettings_T settings)

Get module_fail setting.

Parameters
settingsa SMFSettings_T object
Returns
module_fail setting
SMFList_T* smf_settings_get_modules ( SMFSettings_T settings)

Get available modules.

Parameters
settingsa SMFSettings_T object
Returns
modules list
char* smf_settings_get_nexthop ( SMFSettings_T settings)

Get configured nexthop setting.

Parameters
settingsa SMFSettings_T object
Returns
nexthop
int smf_settings_get_nexthop_fail_code ( SMFSettings_T settings)

Get nexthop_fail_code setting.

Parameters
settingsa SMFSettings_T object
Returns
nexthop_fail_code
char* smf_settings_get_nexthop_fail_msg ( SMFSettings_T settings)

Get nexthop_fail_msg setting.

Parameters
settingsa SMFSettings_T object
Returns
nexthop fail message
char* smf_settings_get_pid_file ( SMFSettings_T settings)

Get current pid file.

Parameters
settingsa SMFSettings_T object
Returns
char pointer with pid file path
char* smf_settings_get_queue_dir ( SMFSettings_T settings)

Get queue directory path.

Parameters
settingsa SMFSettings_T object
Returns
queue directory
char* smf_settings_get_smtp_code ( SMFSettings_T settings,
int  code 
)

Get smtp return code message of given code.

Parameters
settingsa SMFSettings_T object
codeto look for
Returns
smtp return message for given code
int smf_settings_get_smtpd_timeout ( SMFSettings_T settings)

Get time limit for receiving a remote SMTP client request.

Parameters
settingsa SMFSettings_T object
Returns
timeout smtpd timeout in seconds
int smf_settings_get_spare_childs ( SMFSettings_T settings)

Get number of spare processes.

Parameters
settingsa SMFSettings_T object
Returns
number of spare processes
char* smf_settings_get_sql_driver ( SMFSettings_T settings)

Get sql_driver setting.

Parameters
settingsa SMFSettings_T object
Returns
sql_driver value
char* smf_settings_get_sql_encoding ( SMFSettings_T settings)

Get SQL encoding.

Parameters
settingsa SMFSettings_T object
Returns
sql encoding
SMFList_T* smf_settings_get_sql_hosts ( SMFSettings_T settings)

Get SQL host(s)

Parameters
settingsa SMFSettings_T object
Returns
sql_host list
int smf_settings_get_sql_max_connections ( SMFSettings_T settings)

Get max. number of SQL connections.

Parameters
settingsa SMFSettings_T object
Returns
number of max. connections
char* smf_settings_get_sql_name ( SMFSettings_T settings)

Get SQL database name.

Parameters
settingsa SMFSettings_T object
Returns
sql_name value
char* smf_settings_get_sql_pass ( SMFSettings_T settings)

Get SQL password.

Parameters
settingsa SMFSettings_T object
Returns
sql_pass value
int smf_settings_get_sql_port ( SMFSettings_T settings)

Get SQL port.

Parameters
settingsa SMFSettings_T object
Returns
sql_port value
char* smf_settings_get_sql_user ( SMFSettings_T settings)

Get SQL username.

Parameters
settingsa SMFSettings_T object
Returns
sql_user value
char* smf_settings_get_sql_user_query ( SMFSettings_T settings)

Get sql_user_query setting.

Parameters
settingsa SMFSettings_T object
Returns
sql user query value
int smf_settings_get_syslog_facility ( SMFSettings_T settings)

Get syslog facility.

Parameters
settingsa SMFSettings_T object
Returns
syslog facility
SMFTlsOption_T smf_settings_get_tls ( SMFSettings_T settings)

Get tls setting.

Parameters
settingsa SMFSettings_T object
Returns
a SMFTlsOption_T value
char* smf_settings_get_user ( SMFSettings_T settings)

Get effective user.

Parameters
settingsa SMFSettings_T object
Returns
char pointer with username
char* smf_settings_group_get ( SMFSettings_T settings,
char *  group_name,
char *  key 
)

Returns the raw value associated with key under the selected group.

Parameters
settingsa SMFSettings_T object
group_namename of the settings section
keya key
Returns
a newly allocated string or NULL if the specified key cannot be found.
int smf_settings_group_get_boolean ( SMFSettings_T settings,
char *  group_name,
char *  key 
)

Returns the boolean values associated with key under the selected group as integer.

Parameters
settingsa SMFSettings_T object
group_namename of the settings section
keya key
Returns
the value associated with the key as a integer, 1 if true, 0 if false
int smf_settings_group_get_integer ( SMFSettings_T settings,
char *  group_name,
char *  key 
)

Returns the value associated with key under the selected group as an integer.

Parameters
settingsa SMFSettings_T object
group_namename of the settings section
keya key
Returns
he value associated with the key as an integer, or 0 if the key was not found or could not be parsed.
SMFList_T* smf_settings_group_get_list ( SMFSettings_T settings,
char *  group_name,
char *  key 
)

Returns the values associated with key under the selected group.

Parameters
settingsa SMFSettings_T object
group_namename of the settings section
keya key
Returns
a newly allocated SMFList_T object or NULL on failure
void smf_settings_set_add_header ( SMFSettings_T settings,
int  i 
)

Define if spmfilter should add it's own header.

Parameters
settingsa SMFSettings_T object
iadd_header value, either 1 (true) or 0 (false)
void smf_settings_set_backend ( SMFSettings_T settings,
char *  backend 
)

Set lookup backend.

Parameters
settingsa SMFSettings_T object
backendbackend setting list
void smf_settings_set_backend_connection ( SMFSettings_T settings,
char *  conn 
)

Set backend_connection setting. If there are multiple server configured in the specified backend, it's possible to define a failover or load-balancing behaviour. Possible values are: balance = when you configure the backend profile for load balancing, spmfilter distributes connections across the list of hosts. If the actual host is not reachable, spmfilter switches back to failover configuration. failover = when you configure the backend profile for failover, spmfilter fails over to the next host in the list if it cannot connect to the first host.

Parameters
settingsa SMFSettings_T object
connbackend connection
void smf_settings_set_bind_ip ( SMFSettings_T settings,
char *  ip 
)

Set bind ip.

Parameters
settingsa SMFSettings_T object
ipchar pointer with ip
void smf_settings_set_bind_port ( SMFSettings_T settings,
int  port 
)

Set bind port.

Parameters
settingsa SMFSettings_T object
portport number
int smf_settings_set_config_file ( SMFSettings_T settings,
char *  cf 
)

Set path to config file.

Parameters
settingsa SMFSettings_T object
cfconfig file
Returns
0 on success or -1 in case of error
int smf_settings_set_debug ( SMFSettings_T settings,
int  debug 
)

Set debug setting.

Parameters
settingsa SMFSettings_T object
debugdebug setting either 0 (false) or 1 (true)
Returns
0 on success or -1 in case of error
void smf_settings_set_engine ( SMFSettings_T settings,
char *  engine 
)

Set engine which should be used.

Parameters
settingsa SMFSettings_T object
engineengine
void smf_settings_set_foreground ( SMFSettings_T settings,
int  foreground 
)

Set foreground config option.

Parameters
settingsa SMFSettings_T object
foregroundforeground config options (1 = true, 0 = false)
void smf_settings_set_group ( SMFSettings_T settings,
char *  group 
)

Set effective group.

Parameters
settingsa SMFSettings_T object
groupeffective groupname
void smf_settings_set_ldap_base ( SMFSettings_T settings,
char *  base 
)

Set LDAP search base.

Parameters
settingsa SMFSettings_T object
baseldap base value
void smf_settings_set_ldap_binddn ( SMFSettings_T settings,
char *  binddn 
)

Set LDAP binddn.

Parameters
settingsa SMFSettings_T object
binddnldap binddn value
void smf_settings_set_ldap_bindpw ( SMFSettings_T settings,
char *  bindpw 
)

Set LDAP bind password.

Parameters
settingsa SMFSettings_T object
bindpwldap bindpw value
void smf_settings_set_ldap_port ( SMFSettings_T settings,
int  port 
)

Set LDAP port.

Parameters
settingsa SMFSettings_T object
portldap port value
void smf_settings_set_ldap_referrals ( SMFSettings_T settings,
int  i 
)

Set ldap_referrals setting.

Parameters
settingsa SMFSettings_T object
ildap referrals value
void smf_settings_set_ldap_scope ( SMFSettings_T settings,
char *  scope 
)

Set LDAP scope Possible values are:

  • subtree
  • onelevel
  • base
    Parameters
    settingsa SMFSettings_T object
    scopeldap scope value
void smf_settings_set_ldap_uri ( SMFSettings_T settings,
char *  uri 
)

Set LDAP uri.

Parameters
settingsa SMFSettings_T object
urildap uri value
void smf_settings_set_ldap_user_query ( SMFSettings_T settings,
char *  query 
)

Set LDAP user query.

Parameters
settingsa SMFSettings_T object
queryldap user query
void smf_settings_set_lib_dir ( SMFSettings_T settings,
char *  lib_dir 
)

Set path to shared libraries, if needed.

Parameters
settingsa SMFSettings_T object
lib_dirpath to shared libraries folder
void smf_settings_set_listen_backlog ( SMFSettings_T settings,
int  backlog 
)

Set listen backlog.

Parameters
settingsa SMFSettings_T object
backlogmax. number of listen backlog queue
void smf_settings_set_lookup_persistent ( SMFSettings_T settings,
int  persistent 
)

Set lookup connection persistent.

Parameters
settingsa SMFSettings_T object
persistentvalue as integer, 1 if true, 0 if false
void smf_settings_set_max_childs ( SMFSettings_T settings,
int  max_childs 
)

Set the number of maximal allowed processes.

Parameters
settingsa SMFSettings_T object
max_childsnumber of processes
void smf_settings_set_max_size ( SMFSettings_T settings,
unsigned long  size 
)

Set max. allowed message size in byte.

Parameters
settingsa SMFSettings_T object
sizemax_size setting
void smf_settings_set_module_fail ( SMFSettings_T settings,
int  i 
)

Set module_fail setting 1 = proceed and ignore 2 = cancel further processing and return permanet error 3 = cancel further processing and return temporary error (default)

Parameters
settingsa SMFSettings_T object
imodule_fail value
void smf_settings_set_nexthop ( SMFSettings_T settings,
char *  nexthop 
)

Set nexthop setting. This parameter specifies the final destination, after a mail is processed by spmfilter.

Parameters
settingsa SMFSettings_T object
nexthopnexthtop string
void smf_settings_set_nexthop_fail_code ( SMFSettings_T settings,
int  i 
)

Set nexthop_fail_code setting If the delivery to the final destination fails for any reason, this code is used as response to the sending MTA (default 451).

Parameters
settingsa SMFSettings_T object
inexthop_fail_code value
void smf_settings_set_nexthop_fail_msg ( SMFSettings_T settings,
char *  msg 
)

Set nexthop_fail_msg setting. If the delivery to the final destination fails for any reason, this message is used as reponse for the sending MTA. (default "Requested action aborted: local error in processing").

Parameters
settingsa SMFSettings_T object
msgnexthop fail message
void smf_settings_set_pid_file ( SMFSettings_T settings,
char *  pid_file 
)

Set pid file.

Parameters
settingsa SMFSettings_T object
pid_filechar pointer with pid file path
int smf_settings_set_queue_dir ( SMFSettings_T settings,
char *  qd 
)

Set path to queue directory.

Parameters
settingsa SMFSettings_T object
qdqueue directory path
Returns
0 on success or -1 in case of error
int smf_settings_set_smtp_code ( SMFSettings_T settings,
int  code,
char *  msg 
)

Add smtp return code to list.

Parameters
settingsa SMFSettings_T object
codesmtp code
msgsmtp return message
Returns
0 on success or -1 in case of error
void smf_settings_set_smtpd_timeout ( SMFSettings_T settings,
int  timeout 
)

Set time limit for receiving a remote SMTP client request.

Parameters
settingsa SMFSettings_T object
timeouttimeout limit in seconds
void smf_settings_set_spare_childs ( SMFSettings_T settings,
int  spare_childs 
)

Set the number of spare child processes.

Parameters
settingsa SMFSettings_T object
spare_childsnumber of spare processes
void smf_settings_set_sql_driver ( SMFSettings_T settings,
char *  driver 
)

Set SQL driver, which should be used. Possible values are:

  • mysql
  • postgresql
  • sqlite
    Parameters
    settingsa SMFSettings_T object
    driversql_driver value
void smf_settings_set_sql_encoding ( SMFSettings_T settings,
char *  encoding 
)

Set SQL encoding.

Parameters
settingsa SMFSettings_T object
encodingsql encoding
void smf_settings_set_sql_max_connections ( SMFSettings_T settings,
int  i 
)

Set max. number of SQL connections.

Parameters
settingsa SMFSettings_T object
inumber of max allowed connections
void smf_settings_set_sql_name ( SMFSettings_T settings,
char *  name 
)

Set SQL database name.

Parameters
settingsa SMFSettings_T object
namedatabase name
void smf_settings_set_sql_pass ( SMFSettings_T settings,
char *  pass 
)

Set SQL password.

Parameters
settingsa SMFSettings_T object
passsql_pass value
void smf_settings_set_sql_port ( SMFSettings_T settings,
int  port 
)

Set SQL port.

Parameters
settingsa SMFSettings_T object
portsql port
void smf_settings_set_sql_user ( SMFSettings_T settings,
char *  user 
)

Set SQL username.

Parameters
settingsa SMFSettings_T object
usersql user value
void smf_settings_set_sql_user_query ( SMFSettings_T settings,
char *  query 
)

Set sql_user_query setting.

Parameters
settingsa SMFSettings_T object
querysql user query value
void smf_settings_set_syslog_facility ( SMFSettings_T settings,
char *  facility 
)

Set syslog facility.

Parameters
settingsa SMFSettings_T object
facilitysyslog facility
void smf_settings_set_tls ( SMFSettings_T settings,
SMFTlsOption_T  t 
)

Set tls setting.

Parameters
settingsa SMFSettings_T object
ta SMFTlsOption_T value
void smf_settings_set_user ( SMFSettings_T settings,
char *  user 
)

Set effective user.

Parameters
settingsa SMFSettings_T object
usereffective username