*
* This program is open source software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 3.
*
* This program is open source software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 3.
- safestrncpy(config.c_default_cal_zone, buf, sizeof config.c_default_cal_zone);
- syslog(LOG_INFO, "Configuring timezone: %s", config.c_default_cal_zone);
+ CtdlSetConfigStr("c_default_cal_zone", buf);
+ syslog(LOG_INFO, "Configuring timezone: %s", buf);
* Note that if the previous version was 0 then this is a new installation running for the first time.
*/
void update_config(void) {
* Note that if the previous version was 0 then this is a new installation running for the first time.
*/
void update_config(void) {
- if (CitControl.version < 606) {
- config.c_rfc822_strict_from = 0;
+ int oldver = CtdlGetConfigInt("MM_hosted_upgrade_level");
+
+ if (oldver < 606) {
+ CtdlSetConfigInt("c_rfc822_strict_from", 0);
- if (CitControl.version < 725) {
- config.c_xmpp_c2s_port = 5222;
- config.c_xmpp_s2s_port = 5269;
+ if (oldver < 725) {
+ CtdlSetConfigInt("c_xmpp_c2s_port", 5222);
+ CtdlSetConfigInt("c_xmpp_s2s_port", 5269);
- if (CitControl.version < 830) {
- config.c_nntp_port = 119;
- config.c_nntps_port = 563;
+ if (oldver < 830) {
+ CtdlSetConfigInt("c_nntp_port", 119);
+ CtdlSetConfigInt("c_nntps_port", 563);
- (CitControl.version / 100),
- (CitControl.version % 100)
+ (CtdlGetConfigInt("MM_hosted_upgrade_level") / 100),
+ (CtdlGetConfigInt("MM_hosted_upgrade_level") % 100)
struct ctdlroom QRoom;
if (!CtdlGetRoom(&QRoom, SMTP_SPOOLOUT_ROOM)) {
QRoom.QRdefaultview = VIEW_QUEUE;
struct ctdlroom QRoom;
if (!CtdlGetRoom(&QRoom, SMTP_SPOOLOUT_ROOM)) {
QRoom.QRdefaultview = VIEW_QUEUE;
- if (config.c_maxsessions < 0) {
- config.c_maxsessions = 0;
+ if (CtdlGetConfigInt("c_maxsessions") < 0) {
+ CtdlSetConfigInt("c_maxsessions", 0);
}
/* We need a system default message expiry policy, because this is
* the top level and there's no 'higher' policy to fall back on.
* By default, do not expire messages at all.
*/
}
/* We need a system default message expiry policy, because this is
* the top level and there's no 'higher' policy to fall back on.
* By default, do not expire messages at all.
*/
- if (config.c_ep.expire_mode == 0) {
- config.c_ep.expire_mode = EXPIRE_MANUAL;
- config.c_ep.expire_value = 0;
+ if (CtdlGetConfigInt("c_ep_mode") == 0) {
+ CtdlSetConfigInt("c_ep_mode", EXPIRE_MANUAL);
+ CtdlSetConfigInt("c_ep_value", 0);