/*
-* \file funambol65.c
-* @author Mathew McBride
-*
-* This module facilitates notifications to a Funambol server
-* for push email
-*
-* Based on bits of the previous serv_funambol
-* Contact: <matt@mcbridematt.dhs.org> / <matt@comalies>
-*/
-#include "extnotify.h"
+ * funambol65.c
+ * Author: Mathew McBride
+ *
+ * This module facilitates notifications to a Funambol server
+ * for push email
+ *
+ * Based on bits of the previous serv_funambol
+ * Contact: <matt@mcbridematt.dhs.org> / <matt@comalies>
+ *
+ * Copyright (c) 2008-2009
+ *
+ * This program is free 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.
+ *
+ * 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 <stdio.h>
#include <string.h>
#include "msgbase.h"
#include "ctdl_module.h"
+#include "extnotify.h"
+
/*
* \brief Sends a message to the Funambol server notifying
* of new mail for a user
const char* template, long tlen,
char *user,
char *msgid,
- long MsgNum)
+ long MsgNum,
+ NotifyContext *Ctx)
{
char curl_errbuf[CURL_ERROR_SIZE];
char *pchs, *pche;
curl_easy_setopt(curl, CURLOPT_INTERFACE, config.c_ip_addr);
}
- headers = curl_slist_append(headers,"Accept: application/soap+xml, application/dime, multipart/related, text/*");
+ headers = curl_slist_append(headers,"Accept: application/soap+xml, application/mime, multipart/related, text/*");
headers = curl_slist_append(headers,"Pragma: no-cache");
if (tlen > 0) {
/* pass our list of custom made headers */
contenttype=(char*) malloc(40+strlen(mimetype));
- sprintf(contenttype,"Content-type: %s; charset=utf-8", mimetype);
+ sprintf(contenttype,"Content-Type: %s; charset=utf-8", mimetype);
headers = curl_slist_append(headers, "SOAPAction: \"\"");
headers = curl_slist_append(headers, contenttype);
}
else
StrBufAppendBufPlain(ErrMsg, HKEY("\n\nThere was no Serverreply.\n\n"), 0);
-/* TODO: this will change the floor we're in :(
- quickie_message("Citadel", NULL, NULL, AIDEROOM, ChrPtr(ErrMsg), FMT_FIXED,
- "Failed to notify external service about inbound mail");
-*/
- FreeStrBuf(&ErrMsg);
+ ExtNotify_PutErrorMessage(Ctx, ErrMsg);
}
CtdlLogPrintf(CTDL_DEBUG, "Funambol notified\n");