* Based on bits of serv_funambol
* Contact: <matt@mcbridematt.dhs.org> / <matt@comalies>
*
- * Copyright (c) 2008-2011
+ * Copyright (c) 2008-2015
*
* 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
* 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
*/
if (pche == NULL) {
syslog(LOG_ERR,
"extnotify: filename of notification "
- "template not found in %s.\n",
+ "template not found in %s.",
pchs);
continue;
}
cdb_free(cdbfr);
} else {
syslog(LOG_DEBUG,
- "extNotify_getConfigMessage: "
- "No config messages found\n");
+ "extNotify_getConfigMessage: "
+ "No config messages found");
return eNone; /* No messages at all? No further action. */
}
for (a = 0; a < num_msgs; ++a) {
- msg = CtdlFetchMessage(msglist[a], 1);
+ msg = CtdlFetchMessage(msglist[a], 1, 1);
if (msg != NULL) {
if (!CM_IsEmpty(msg, eMsgSubject) &&
(strncasecmp(msg->cm_fields[eMsgSubject],
Ctx = (NotifyContext*) usrdata;
- msg = CtdlFetchMessage(NotifyMsgnum, 1);
+ msg = CtdlFetchMessage(NotifyMsgnum, 1, 1);
if (!CM_IsEmpty(msg, eExtnotify))
{
Type = extNotify_getConfigMessage(
{
case eFunambol:
snprintf(remoteurl, SIZ, "http://%s@%s:%d/%s",
- config.c_funambol_auth,
- config.c_funambol_host,
- config.c_funambol_port,
+ CtdlGetConfigStr("c_funambol_auth"),
+ CtdlGetConfigStr("c_funambol_host"),
+ CtdlGetConfigInt("c_funambol_port"),
FUNAMBOL_WS);
notify_http_server(remoteurl,
int commandSiz;
char *command;
- commandSiz = sizeof(config.c_pager_program) +
+ commandSiz = sizeof(CtdlGetConfigStr("c_pager_program")) +
strlen(PagerNo) +
- strlen(msg->cm_fields[eExtnotify]) + 5;
+ msg->cm_lengths[eExtnotify] + 5;
command = malloc(commandSiz);
snprintf(command,
commandSiz,
"%s %s -u %s",
- config.c_pager_program,
+ CtdlGetConfigStr("c_pager_program"),
PagerNo,
msg->cm_fields[eExtnotify]);
* don't really require extremely fine granularity here, we'll do it
* with a static variable instead.
*/
- if (IsEmptyStr(config.c_pager_program) &&
- IsEmptyStr(config.c_funambol_host))
+ if (IsEmptyStr(CtdlGetConfigStr("c_pager_program")) &&
+ IsEmptyStr(CtdlGetConfigStr("c_funambol_host")))
{
- syslog(LOG_ERR,
- "No external notifiers configured on system/user\n");
+ syslog(LOG_DEBUG,
+ "No external notifiers configured on system/user");
return;
}
/*
* Go ahead and run the queue
*/
- syslog(LOG_DEBUG, "serv_extnotify: processing notify queue\n");
+ syslog(LOG_DEBUG, "serv_extnotify: processing notify queue");
memset(&Ctx, 0, sizeof(NotifyContext));
if ((GetNotifyHosts(&Ctx) > 0) &&
(CtdlGetRoom(&CC->room, FNBL_QUEUE_ROOM) != 0))
{
- syslog(LOG_ERR, "Cannot find room <%s>\n", FNBL_QUEUE_ROOM);
+ syslog(LOG_ERR, "Cannot find room <%s>", FNBL_QUEUE_ROOM);
if (Ctx.nNotifyHosts > 0)
{
for (i = 0; i < Ctx.nNotifyHosts * 2; i++)
}
CtdlForEachMessage(MSGS_ALL, 0L, NULL,
SPOOLMIME, NULL, process_notify, &Ctx);
- syslog(LOG_DEBUG, "serv_extnotify: queue run completed\n");
+ syslog(LOG_DEBUG, "serv_extnotify: queue run completed");
doing_queue = 0;
if (Ctx.nNotifyHosts > 0)
{
/* If this is private, local mail, make a copy in the
* recipient's mailbox and bump the reference count.
*/
- if (!IsEmptyStr(config.c_funambol_host) || !IsEmptyStr(config.c_pager_program))
+ if (!IsEmptyStr(CtdlGetConfigStr("c_funambol_host")) || !IsEmptyStr(CtdlGetConfigStr("c_pager_program")))
{
/* Generate a instruction message for the Funambol notification
* server, in the same style as the SMTP queue