CM_SetField(bmsg, eOriginalRoom, HKEY(MAILROOM));
CM_SetField(bmsg, eAuthor, HKEY("Citadel"));
- CM_SetField(bmsg, eNodeName, CFG_KEY(c_nodename));
+ CM_SetField(bmsg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
CM_SetField(bmsg, eMsgSubject, HKEY("Delivery Status Notification (Failure)"));
CM_SetAsFieldSB(bmsg, eMesageText, &BounceMB);
* RFC 2822 - Internet Message Format
* RFC 2920 - SMTP Service Extension for Command Pipelining
*
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-2015 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 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.
*
- * 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.
- *
- *
- *
- *
+ * 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.
*/
#include "sysdep.h"
/* At this point we know we are talking to a real SMTP server */
/* Do a EHLO command. If it fails, try the HELO command. */
- StrBufPrintf(Msg->IO.SendBuf.Buf,
- "EHLO %s\r\n", config.c_fqdn);
+ StrBufPrintf(Msg->IO.SendBuf.Buf, "EHLO %s\r\n", CtdlGetconfigStr("c_fqdn"));
SMTP_DBG_SEND();
return eReadMessage;
eNextState STMPC_send_HELO(SmtpOutMsg *Msg)
{
AsyncIO *IO = &Msg->IO;
- StrBufPrintf(Msg->IO.SendBuf.Buf,
- "HELO %s\r\n", config.c_fqdn);
+ StrBufPrintf(Msg->IO.SendBuf.Buf, "HELO %s\r\n", CtdlGetconfigStr("c_fqdn"));
SMTP_DBG_SEND();
return eReadMessage;
* The VRFY and EXPN commands have been removed from this implementation
* because nobody uses these commands anymore, except for spammers.
*
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-2015 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 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.
*
- * 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.
- *
- *
- *
- *
+ * 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.
*/
#include "sysdep.h"
strcpy(bounceto, "");
boundary = NewStrBufPlain(HKEY("=_Citadel_Multipart_"));
- StrBufAppendPrintf(boundary,
- "%s_%04x%04x",
- config.c_fqdn,
- getpid(),
- ++seq);
+ StrBufAppendPrintf(boundary, "%s_%04x%04x", CtdlGetConfigStr("c_fqdn"), getpid(), ++seq);
lines = num_tokens(instr, '\n');
bmsg->cm_format_type = FMT_RFC822;
CM_SetField(bmsg, eAuthor, HKEY("Citadel"));
CM_SetField(bmsg, eOriginalRoom, HKEY(MAILROOM));
- CM_SetField(bmsg, eNodeName, CFG_KEY(c_nodename));
+ CM_SetField(bmsg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
CM_SetField(bmsg, eMsgSubject, HKEY("Delivery Status Notification (Failure)"));
- StrBufAppendBufPlain(
- BounceMB,
- HKEY("Content-type: multipart/mixed; boundary=\""), 0);
+ StrBufAppendBufPlain(BounceMB, HKEY("Content-type: multipart/mixed; boundary=\""), 0);
StrBufAppendBuf(BounceMB, boundary, 0);
StrBufAppendBufPlain(BounceMB, HKEY("\"\r\n"), 0);
StrBufAppendBufPlain(BounceMB, HKEY("MIME-Version: 1.0\r\n"), 0);
/* If not, post it in the Aide> room */
if (successful_bounce == 0) {
- CtdlSubmitMsg(bmsg, NULL, config.c_aideroom, QP_EADDR);
+ CtdlSubmitMsg(bmsg, NULL, CtdlGetConfigStr("c_aideroom"), QP_EADDR);
}
/* Free up the memory we used */
if (fp) {
if (fgets(buf, sizeof buf, fp) && (strlen(buf) > 2)) {
buf[strlen(buf)-1] = 0;
- 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);
}
fclose(fp);
}
*/
void update_config(void) {
- if (CitControl.MM_hosted_upgrade_level < 606) {
+ oldver = CitControl.MM_hosted_upgrade_level;
+
+ if (oldver < 606) {
config.c_rfc822_strict_from = 0;
}
- if (CitControl.MM_hosted_upgrade_level < 609) {
+ if (oldver < 609) {
config.c_purge_hour = 3;
}
- if (CitControl.MM_hosted_upgrade_level < 615) {
+ if (oldver < 615) {
config.c_ldap_port = 389;
}
- if (CitControl.MM_hosted_upgrade_level < 623) {
+ if (oldver < 623) {
strcpy(config.c_ip_addr, "*");
}
- if (CitControl.MM_hosted_upgrade_level < 650) {
+ if (oldver < 650) {
config.c_enable_fulltext = 1;
}
- if (CitControl.MM_hosted_upgrade_level < 652) {
+ if (oldver < 652) {
config.c_auto_cull = 1;
}
- if (CitControl.MM_hosted_upgrade_level < 725) {
+ if (oldver < 725) {
config.c_xmpp_c2s_port = 5222;
config.c_xmpp_s2s_port = 5269;
}
- if (CitControl.MM_hosted_upgrade_level < 830) {
+ if (oldver < 830) {
config.c_nntp_port = 119;
config.c_nntps_port = 563;
}
if (IsEmptyStr(config.c_default_cal_zone)) {
guess_time_zone();
}
-
- put_config();
}
* A server-side module for Citadel which supports address book information
* using the standard vCard format.
*
- * Copyright (c) 1999-2012 by the citadel.org team
+ * Copyright (c) 1999-2015 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 version 3.
/* If users cannot create their own accounts, they cannot re-register either. */
if ( (yes_my_citadel_config) &&
- (config.c_disable_newu) &&
+ (CtdlGetConfigInt("c_disable_newu")) &&
(CCC->user.axlevel < AxAideU) &&
(CCC->vcard_updated_by_ldap==0) )
{
/* Insert or replace RFC2739-compliant free/busy URL */
if (yes_my_citadel_config) {
sprintf(buf, "http://%s/%s.vfb",
- config.c_fqdn,
+ CtdlGetConfigStr("c_fqdn"),
usbuf.fullname);
for (i=0; buf[i]; ++i) {
if (buf[i] == ' ') buf[i] = '_';
}
/* If users cannot create their own accounts, they cannot re-register either. */
- if ( (config.c_disable_newu) && (CCC->user.axlevel < AxAideU) ) {
+ if ( (CtdlGetConfigInt("c_disable_newu")) && (CCC->user.axlevel < AxAideU) ) {
cprintf("%d Self-service registration is not allowed here.\n",
ERROR + HIGHER_ACCESS_REQUIRED);
}
#ifdef HAVE_GETPWUID_R
/* If using host auth mode, we add an email address based on the login */
- if (config.c_auth_mode == AUTHMODE_HOST) {
+ if (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_HOST) {
struct passwd pwd;
char pwd_buffer[SIZ];
syslog(LOG_DEBUG, "Searching for uid %d", usbuf->uid);
if (getpwuid_r(usbuf->uid, &pwd, pwd_buffer, sizeof pwd_buffer, &result) == 0) {
#endif // HAVE_GETPWUID_R
- snprintf(buf, sizeof buf, "%s@%s", pwd.pw_name, config.c_fqdn);
+ snprintf(buf, sizeof buf, "%s@%s", pwd.pw_name, CtdlGetConfigStr("c_fqdn"));
vcard_add_prop(v, "email;internet", buf);
need_default_vcard=0;
}
* Is this an LDAP session? If so, copy various LDAP attributes from the directory entry
* into the user's vCard.
*/
- if ((config.c_auth_mode == AUTHMODE_LDAP) || (config.c_auth_mode == AUTHMODE_LDAP_AD)) {
+ if ((CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP) || (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP_AD)) {
//uid_t ldap_uid;
int found_user;
char ldap_cn[512];
#endif
if (need_default_vcard!=0) {
/* Everyone gets an email address based on their display name */
- snprintf(buf, sizeof buf, "%s@%s", usbuf->fullname, config.c_fqdn);
+ snprintf(buf, sizeof buf, "%s@%s", usbuf->fullname, CtdlGetConfigStr("c_fqdn"));
for (i=0; buf[i]; ++i) {
if (buf[i] == ' ') buf[i] = '_';
}
msg->cm_format_type = 0;
CM_SetField(msg, eAuthor, usbuf->fullname, strlen(usbuf->fullname));
CM_SetField(msg, eOriginalRoom, HKEY(ADDRESS_BOOK_ROOM));
- CM_SetField(msg, eNodeName, CFG_KEY(c_nodename));
+ CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
CM_SetField(msg, eMesageText, HKEY("Purge this vCard\n"));
len = snprintf(buf, sizeof buf, VCARD_EXT_FORMAT,
* Is this an LDAP session? If so, copy various LDAP attributes from the directory entry
* into the user's vCard.
*/
- if ((config.c_auth_mode == AUTHMODE_LDAP) || (config.c_auth_mode == AUTHMODE_LDAP_AD)) {
+ if ((CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP) || (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP_AD)) {
v = vcard_get_user(&CCC->user);
if (v) {
if (Ctdl_LDAP_to_vCard(CCC->ldap_dn, v)) {
}
/* for postfix tcpdict */
- CtdlRegisterServiceHook(config.c_pftcpdict_port, /* Postfix */
+ CtdlRegisterServiceHook(CtdlGetConfigInt("c_pftcpdict_port"), /* Postfix */
NULL,
check_get_greeting,
check_get,
CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
CM_SetField(msg, erFc822Addr, CCC->cs_inet_email, strlen(CCC->cs_inet_email));
CM_SetField(msg, eOriginalRoom, CCC->room.QRname, strlen(CCC->room.QRname));
- CM_SetField(msg, eNodeName, CFG_KEY(c_nodename));
+ CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
CM_SetField(msg, eExclusiveID, pagename, strlen(pagename));
msgnum = CtdlSubmitMsg(msg, NULL, "", 0); /* Replace the current revision */
}