/*
* Transparently handle the upgrading of server data formats.
*
- * Copyright (c) 1987-2011 by the citadel.org team
+ * Copyright (c) 1987-2014 by the citadel.org team
*
* This program is open source 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; either version 3 of the License, or
- * (at your option) any later version.
+ * modify it under the terms of the GNU General Public License version 3.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdep.h"
#include "msgbase.h"
#include "serv_upgrade.h"
#include "euidindex.h"
-
-
#include "ctdl_module.h"
-
/*
* Fix up the name for Citadel user 0 and try to remove any extra users with number 0
*/
/*
- * Do various things to our configuration file
+ * Perform any upgrades that can be done automatically based on our knowledge of the previous
+ * version of Citadel server that was running here.
+ *
+ * Note that if the previous version was 0 then this is a new installation running for the first time.
*/
void update_config(void) {
get_config();
}
if (CitControl.version < 650) {
- config.c_enable_fulltext = 0;
+ config.c_enable_fulltext = 1;
}
if (CitControl.version < 652) {
config.c_xmpp_s2s_port = 5269;
}
+ if (CitControl.version < 830) {
+ config.c_nntp_port = 119;
+ config.c_nntps_port = 563;
+ }
+
if (IsEmptyStr(config.c_default_cal_zone)) {
guess_time_zone();
}
if (CitControl.version < 790) {
remove_thread_users();
}
+ if (CitControl.version < 810) {
+ struct ctdlroom QRoom;
+ if (!CtdlGetRoom(&QRoom, SMTP_SPOOLOUT_ROOM)) {
+ QRoom.QRdefaultview = VIEW_QUEUE;
+ CtdlPutRoom(&QRoom);
+ }
+ if (!CtdlGetRoom(&QRoom, FNBL_QUEUE_ROOM)) {
+ QRoom.QRdefaultview = VIEW_QUEUE;
+ CtdlPutRoom(&QRoom);
+ }
+ }
+
CitControl.version = REV_LEVEL;
+
+ /*
+ * Negative values for maxsessions are not allowed.
+ */
+ if (config.c_maxsessions < 0) {
+ config.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.
+ */
+ if (config.c_ep.expire_mode == 0) {
+ config.c_ep.expire_mode = EXPIRE_MANUAL;
+ config.c_ep.expire_value = 0;
+ }
+
put_control();
}