HashList *ctdlconfig = NULL; // new configuration
-void config_warn_if_port_unset(char *key, int default_port) \
+void config_warn_if_port_unset(char *key, int default_port)
{
int p = CtdlGetConfigInt(key);
if ((p < -1) || (p == 0) || (p > UINT16_MAX))
{
- syslog(LOG_ERR,
- "config: setting %s is not -1 (disabled) or a valid TCP-Port - check your config! Default setting is: %d",
- key, default_port
- );
+ syslog(LOG_ERR, "config: setting %s is not -1 (disabled) or a valid TCP port - setting to default %d", key, default_port);
+ CtdlSetConfigInt(key, default_port);
}
}
config_warn_if_empty("c_aideroom");
config_warn_if_empty("c_twitroom");
config_warn_if_empty("c_nodename");
- config_warn_if_empty("c_default_cal_zone");
/*
* Sanity check for port bindings
*/
- config_warn_if_port_unset("c_smtp_port", 25);
- config_warn_if_port_unset("c_pop3_port", 110);
- config_warn_if_port_unset("c_imap_port", 143);
- config_warn_if_port_unset("c_msa_port", 587);
- config_warn_if_port_unset("c_port_number", 504);
- config_warn_if_port_unset("c_smtps_port", 465);
- config_warn_if_port_unset("c_pop3s_port", 995);
- config_warn_if_port_unset("c_imaps_port", 993);
- config_warn_if_port_unset("c_pftcpdict_port", -1);
- config_warn_if_port_unset("c_managesieve_port", 2020);
- config_warn_if_port_unset("c_xmpp_c2s_port", 5222);
- config_warn_if_port_unset("c_xmpp_s2s_port", 5269);
- config_warn_if_port_unset("c_nntp_port", 119);
- config_warn_if_port_unset("c_nntps_port", 563);
+ config_warn_if_port_unset("c_smtp_port", 25);
+ config_warn_if_port_unset("c_pop3_port", 110);
+ config_warn_if_port_unset("c_imap_port", 143);
+ config_warn_if_port_unset("c_msa_port", 587);
+ config_warn_if_port_unset("c_port_number", 504);
+ config_warn_if_port_unset("c_smtps_port", 465);
+ config_warn_if_port_unset("c_pop3s_port", 995);
+ config_warn_if_port_unset("c_imaps_port", 993);
+ config_warn_if_port_unset("c_pftcpdict_port", -1);
+ config_warn_if_port_unset("c_managesieve_port", 2020);
+ config_warn_if_port_unset("c_xmpp_c2s_port", 5222);
+ config_warn_if_port_unset("c_xmpp_s2s_port", 5269);
+ config_warn_if_port_unset("c_nntp_port", 119);
+ config_warn_if_port_unset("c_nntps_port", 563);
if (getpwuid(ctdluid) == NULL) {
- syslog(LOG_ERR, "config: UID (%d) citadel is configured to use is not defined in your system (/etc/passwd?)!", ctdluid);
+ syslog(LOG_ERR, "config: uid (%d) does not exist ... citserver will run as root", ctdluid);
}
}
CtdlSetConfigInt( "c_pftcpdict_port" , lconfig->c_pftcpdict_port );
CtdlSetConfigInt( "c_managesieve_port" , lconfig->c_managesieve_port );
CtdlSetConfigInt( "c_auth_mode" , lconfig->c_auth_mode );
- CtdlSetConfigStr( "c_funambol_host" , lconfig->c_funambol_host );
- CtdlSetConfigInt( "c_funambol_port" , lconfig->c_funambol_port );
- CtdlSetConfigStr( "c_funambol_source" , lconfig->c_funambol_source );
- CtdlSetConfigStr( "c_funambol_auth" , lconfig->c_funambol_auth );
CtdlSetConfigInt( "c_rbl_at_greeting" , lconfig->c_rbl_at_greeting );
- CtdlSetConfigStr( "c_master_user" , lconfig->c_master_user );
- CtdlSetConfigStr( "c_master_pass" , lconfig->c_master_pass );
CtdlSetConfigStr( "c_pager_program" , lconfig->c_pager_program );
CtdlSetConfigInt( "c_imap_keep_from" , lconfig->c_imap_keep_from );
CtdlSetConfigInt( "c_xmpp_c2s_port" , lconfig->c_xmpp_c2s_port );
if (CtdlGetConfigLong("c_pop3_fastest") == 0) CtdlSetConfigLong("c_pop3_fastest", 3600); // once per hour default
if (CtdlGetConfigLong("c_pop3_fastest") < 300) CtdlSetConfigLong("c_pop3_fastest", 300); // 5 minutes min
+ /* LDAP sync frequency */
+ if (CtdlGetConfigLong("c_ldap_sync_freq") == 0) CtdlSetConfigLong("c_ldap_sync_freq", 300); // every 5 minutes default
+
/* "create new user" only works with native authentication mode */
if (CtdlGetConfigInt("c_auth_mode") != AUTHMODE_NATIVE) {
CtdlSetConfigInt("c_disable_newu", 1);
/* We want the last (and probably only) config in this room */
begin_critical_section(S_CONFIG);
config_msgnum = (-1L);
- CtdlForEachMessage(MSGS_LAST, 1, NULL, sysconfname, NULL,
- CtdlGetSysConfigBackend, NULL);
+ CtdlForEachMessage(MSGS_LAST, 1, NULL, sysconfname, NULL, CtdlGetSysConfigBackend, NULL);
msgnum = config_msgnum;
end_critical_section(S_CONFIG);
CtdlGetRoom(&CC->room, hold_rm);
- if (conf != NULL) do {
+ if (conf != NULL) {
+ do {
extract_token(buf, conf, 0, '\n', sizeof buf);
strcpy(conf, &conf[strlen(buf)+1]);
} while ( (!IsEmptyStr(conf)) && (!IsEmptyStr(buf)) );
+ }
return(conf);
}