* message text.
*/
int convert_field(struct CtdlMessage *msg, const char *beg, const char *end) {
+ struct CitContext *CCC = CC;
char *key, *value, *valueend;
long len;
const char *pos;
else if (!strcasecmp(key, "From")) {
process_rfc822_addr(value, user, node, name);
- syslog(LOG_DEBUG, "Converted to <%s@%s> (%s)\n", user, node, name);
+ MSG_syslog(LOG_DEBUG, "Converted to <%s@%s> (%s)\n", user, node, name);
snprintf(addr, sizeof(addr), "%s@%s", user, node);
if (CM_IsEmpty(msg, eAuthor) && !IsEmptyStr(name))
CM_SetField(msg, eAuthor, name, strlen(name));
void directory_key(char *key, char *addr) {
int i;
int keylen = 0;
+ struct CitContext *CCC = CC;
for (i=0; !IsEmptyStr(&addr[i]); ++i) {
if (!isspace(addr[i])) {
}
key[keylen++] = 0;
- syslog(LOG_DEBUG, "Directory key is <%s>\n", key);
+ MSG_syslog(LOG_DEBUG, "Directory key is <%s>\n", key);
}
*/
int CtdlDirectoryAddUser(char *internet_addr, char *citadel_addr) {
char key[SIZ];
+ struct CitContext *CCC = CC;
if (IsDirectory(internet_addr, 0) == 0)
return 0;
- syslog(LOG_DEBUG, "Create directory entry: %s --> %s\n", internet_addr, citadel_addr);
+ MSG_syslog(LOG_DEBUG, "Create directory entry: %s --> %s\n", internet_addr, citadel_addr);
directory_key(key, internet_addr);
cdb_store(CDB_DIRECTORY, key, strlen(key), citadel_addr, strlen(citadel_addr)+1 );
return 1;
*/
int CtdlDirectoryDelUser(char *internet_addr, char *citadel_addr) {
char key[SIZ];
-
- syslog(LOG_DEBUG, "Delete directory entry: %s --> %s\n", internet_addr, citadel_addr);
+ struct CitContext *CCC = CC;
+
+ MSG_syslog(LOG_DEBUG, "Delete directory entry: %s --> %s\n", internet_addr, citadel_addr);
directory_key(key, internet_addr);
return cdb_delete(CDB_DIRECTORY, key, strlen(key) ) == 0;
}
nActivated++;
if (i > 1) n = MsgCount++;
- syslog(LOG_INFO,
- "SMTPC: giving up on <%ld> <%s> %d / %d \n",
- MyQItem->MessageID,
- ChrPtr(ThisItem->Recipient),
- i,
- m);
+ SMTPC_syslog(LOG_INFO,
+ "SMTPC: giving up on <%ld> <%s> %d / %d \n",
+ MyQItem->MessageID,
+ ChrPtr(ThisItem->Recipient),
+ i,
+ m);
(*((int*) userdata)) ++;
smtp_try_one_queue_entry(MyQItem,
ThisItem,
usleep(delay_msec);
if (i > 1) n = MsgCount++;
- syslog(LOG_DEBUG,
- "SMTPC: Trying <%ld> <%s> %d / %d \n",
- MyQItem->MessageID,
- ChrPtr(ThisItem->Recipient),
- i,
- m);
+ SMTPC_syslog(LOG_DEBUG,
+ "SMTPC: Trying <%ld> <%s> %d / %d \n",
+ MyQItem->MessageID,
+ ChrPtr(ThisItem->Recipient),
+ i,
+ m);
(*((int*) userdata)) ++;
smtp_try_one_queue_entry(MyQItem,
ThisItem,
#include "ctdl_module.h"
#include "smtp_util.h"
+#include "smtpqueue.h"
+#include "smtp_clienthandlers.h"
const char *smtp_get_Recipients(void)
{
StrBuf *BounceMB;
long omsgid = (-1);
- syslog(LOG_DEBUG, "smtp_do_bounce() called\n");
+ SMTPCM_syslog(LOG_DEBUG, "smtp_do_bounce() called");
strcpy(bounceto, "");
boundary = NewStrBufPlain(HKEY("=_Citadel_Multipart_"));
dsnlen = extract_token(dsn, buf, 3, '|', sizeof dsn);
bounce_this = 0;
- syslog(LOG_DEBUG, "key=<%s> addr=<%s> status=%d dsn=<%s>\n",
- key, addr, status, dsn);
+ SMTPC_syslog(LOG_DEBUG, "key=<%s> addr=<%s> status=%d dsn=<%s>",
+ key, addr, status, dsn);
if (!strcasecmp(key, "bounceto")) {
strcpy(bounceto, addr);
CM_SetAsFieldSB(bmsg, eMesageText, &BounceMB);
/* Deliver the bounce if there's anything worth mentioning */
- syslog(LOG_DEBUG, "num_bounces = %d\n", num_bounces);
+ SMTPC_syslog(LOG_DEBUG, "num_bounces = %d\n", num_bounces);
if (num_bounces > 0) {
/* First try the user who sent the message */
- if (IsEmptyStr(bounceto))
- syslog(LOG_ERR, "No bounce address specified\n");
- else
- syslog(LOG_DEBUG, "bounce to user <%s>\n", bounceto);
+ if (IsEmptyStr(bounceto)) {
+ SMTPCM_syslog(LOG_ERR, "No bounce address specified");
+ }
+ else {
+ SMTPC_syslog(LOG_DEBUG, "bounce to user <%s>", bounceto);
+ }
/* Can we deliver the bounce to the original sender? */
valid = validate_recipients(bounceto,
smtp_get_Recipients (),
}
FreeStrBuf(&boundary);
CM_Free(bmsg);
- syslog(LOG_DEBUG, "Done processing bounces\n");
+ SMTPCM_syslog(LOG_DEBUG, "Done processing bounces\n");
}
}
}
- syslog(LOG_DEBUG, "%d sessions for <%s> are now visible to session %d\n", visible_sessions, presence_jid, CC->cs_pid);
+ XMPP_syslog(LOG_DEBUG, "%d sessions for <%s> are now visible to session %d\n", visible_sessions, presence_jid, CC->cs_pid);
if ( (event_type == XMPP_EVT_LOGIN) && (visible_sessions == 1) ) {
- syslog(LOG_DEBUG, "Telling session %d that <%s> logged in\n", CC->cs_pid, presence_jid);
+ XMPP_syslog(LOG_DEBUG, "Telling session %d that <%s> logged in\n", CC->cs_pid, presence_jid);
/* Do an unsolicited roster update that adds a new contact. */
assert(which_cptr_is_relevant >= 0);
}
if (visible_sessions == 0) {
- syslog(LOG_DEBUG, "Telling session %d that <%s> logged out\n",
+ XMPP_syslog(LOG_DEBUG, "Telling session %d that <%s> logged out\n",
CC->cs_pid, presence_jid);
xmpp_destroy_buddy(presence_jid, 0); /* non aggressive presence update */
}
HashList *xmpp_fetch_mortuary(void) {
HashList *mortuary = NewHash(1, NULL);
if (!mortuary) {
- syslog(LOG_ALERT, "NewHash() failed!\n");
+ XMPPM_syslog(LOG_ALERT, "NewHash() failed!\n");
return(NULL);
}
struct CitContext *cptr;
int nContexts, i;
- syslog(LOG_DEBUG, "Roster push!");
+ XMPPM_syslog(LOG_DEBUG, "Roster push!");
cprintf("<query xmlns=\"jabber:iq:roster\">");
cptr = CtdlGetContextArray(&nContexts);
if (cptr) {
long ioid,
time_t NOW)
{
+ struct CitContext *CCC = CC;
int i;
u_char rawdigest[MD5_DIGEST_LEN];
struct MD5Context md5context;
{
FreeStrBuf(&guid);
/* yes, we did. flood protection kicks in. */
- syslog(LOG_DEBUG,
- "not sending message again - %ld < %ld \n", seenstamp, tsday);
+ MSG_syslog(LOG_DEBUG,
+ "not sending message again - %ld < %ld \n", seenstamp, tsday);
return;
}
else
{
- syslog(LOG_DEBUG,
- "sending message. %ld >= %ld", seenstamp, tsday);
+ MSG_syslog(LOG_DEBUG,
+ "sending message. %ld >= %ld", seenstamp, tsday);
FreeStrBuf(&guid);
/* no, this message isn't sent recently; go ahead. */
quickie_message(from,
* in *at least* the old name!
*/
int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
+ struct CitContext *CCC = CC;
int old_floor = 0;
struct ctdlroom qrbuf;
struct ctdlroom qrtmp;
long owner = 0L;
char actual_old_name[ROOMNAMELEN];
- syslog(LOG_DEBUG, "CtdlRenameRoom(%s, %s, %d)", old_name, new_name, new_floor);
+ MSG_syslog(LOG_DEBUG, "CtdlRenameRoom(%s, %s, %d)", old_name, new_name, new_floor);
if (new_floor >= 0) {
fl = CtdlGetCachedFloor(new_floor);
ret = crr_room_not_found;
}
- else if ( (CC->user.axlevel < AxAideU) && (!CC->internal_pgm)
- && (CC->user.usernum != qrbuf.QRroomaide)
- && ( (((qrbuf.QRflags & QR_MAILBOX) == 0) || (atol(qrbuf.QRname) != CC->user.usernum))) ) {
+ else if ( (CCC->user.axlevel < AxAideU) && (!CCC->internal_pgm)
+ && (CCC->user.usernum != qrbuf.QRroomaide)
+ && ( (((qrbuf.QRflags & QR_MAILBOX) == 0) || (atol(qrbuf.QRname) != CCC->user.usernum))) ) {
ret = crr_access_denied;
}
lgetfloor(&flbuf, old_floor);
--flbuf.f_ref_count;
lputfloor(&flbuf, old_floor);
- syslog(LOG_DEBUG, "Reference count for floor %d is now %d", old_floor, flbuf.f_ref_count);
+ MSG_syslog(LOG_DEBUG, "Reference count for floor %d is now %d", old_floor, flbuf.f_ref_count);
lgetfloor(&flbuf, new_floor);
++flbuf.f_ref_count;
lputfloor(&flbuf, new_floor);
- syslog(LOG_DEBUG, "Reference count for floor %d is now %d", new_floor, flbuf.f_ref_count);
+ MSG_syslog(LOG_DEBUG, "Reference count for floor %d is now %d", new_floor, flbuf.f_ref_count);
}
/* ...and everybody say "YATTA!" */