Merge branch 'configdb' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 16 Aug 2015 10:25:07 +0000 (12:25 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 16 Aug 2015 10:25:07 +0000 (12:25 +0200)
Conflicts:
citadel/citserver.c
citadel/config.c
citadel/control.c
citadel/modules/fulltext/serv_fulltext.c
citadel/modules/migrate/serv_migrate.c
citadel/modules/upgrade/serv_upgrade.c
citadel/server.h

29 files changed:
1  2 
citadel/config.c
citadel/control.c
citadel/database.c
citadel/ical_dezonify.c
citadel/include/ctdl_module.h
citadel/modules/autocompletion/serv_autocompletion.c
citadel/modules/calendar/serv_calendar.c
citadel/modules/ctdlproto/serv_messages.c
citadel/modules/expire/serv_expire.c
citadel/modules/extnotify/extnotify_main.c
citadel/modules/fulltext/serv_fulltext.c
citadel/modules/imap/imap_fetch.c
citadel/modules/imap/imap_search.c
citadel/modules/migrate/serv_migrate.c
citadel/modules/network/serv_netmail.c
citadel/modules/network/serv_netspool.c
citadel/modules/network/serv_network.c
citadel/modules/nntp/serv_nntp.c
citadel/modules/pop3client/serv_pop3client.c
citadel/modules/rssclient/serv_rssclient.c
citadel/modules/sieve/serv_sieve.c
citadel/modules/smtp/serv_smtp.c
citadel/modules/smtp/serv_smtpqueue.c
citadel/modules/vcard/serv_vcard.c
citadel/modules/wiki/serv_wiki.c
citadel/modules/xmpp/xmpp_presence.c
citadel/msgbase.c
citadel/room_ops.c
citadel/server_main.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 86cad97b4a7144f83f91963e776c09f0c9279f7c,9698c3694f1f3aceb4f3100459a539505601f4f5..eeb35ba71b8fd060254ca953c498ffcdfae5812c
  #endif
  
  
-       snprintf(bouncesource, sizeof bouncesource, "%s@%s", BOUNCESOURCE, config.c_nodename);
 +/*
 + * Bounce a message back to the sender
 + */
 +void network_bounce(struct CtdlMessage **pMsg, char *reason)
 +{
 +      struct CitContext *CCC = CC;
 +      char buf[SIZ];
 +      char bouncesource[SIZ];
 +      char recipient[SIZ];
 +      recptypes *valid = NULL;
 +      char force_room[ROOMNAMELEN];
 +      static int serialnum = 0;
 +      long len;
 +      struct CtdlMessage *msg = *pMsg;
 +      *pMsg = NULL;
 +      QNM_syslog(LOG_DEBUG, "entering network_bounce()\n");
 +
 +      if (msg == NULL) return;
 +
-                      config.c_fqdn);
++      snprintf(bouncesource, sizeof bouncesource, "%s@%s", BOUNCESOURCE, CtdlGetConfigStr("c_nodename"));
 +
 +      /* 
 +       * Give it a fresh message ID
 +       */
 +      len = snprintf(buf, sizeof(buf),
 +                     "%ld.%04lx.%04x@%s",
 +                     (long)time(NULL),
 +                     (long)getpid(),
 +                     ++serialnum,
-       CM_SetField(msg, eNodeName, CFG_KEY(c_nodename));
++                     CtdlGetConfigStr("c_fqdn"));
 +
 +      CM_SetField(msg, emessageId, buf, len);
 +
 +      /*
 +       * FIXME ... right now we're just sending a bounce; we really want to
 +       * include the text of the bounced message.
 +       */
 +      CM_SetField(msg, eMesageText, reason, strlen(reason));
 +      msg->cm_format_type = 0;
 +
 +      /*
 +       * Turn the message around
 +       */
 +      CM_FlushField(msg, eRecipient);
 +      CM_FlushField(msg, eDestination);
 +
 +      len = snprintf(recipient, sizeof(recipient), "%s@%s",
 +                     msg->cm_fields[eAuthor],
 +                     msg->cm_fields[eNodeName]);
 +
 +      CM_SetField(msg, eAuthor, HKEY(BOUNCESOURCE));
-               strcpy(force_room, config.c_aideroom);
++      CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
 +      CM_SetField(msg, eMsgSubject, HKEY("Delivery Status Notification (Failure)"));
 +
 +      Netmap_AddMe(msg, HKEY("unknown_user"));
 +
 +      /* Now submit the message */
 +      valid = validate_recipients(recipient, NULL, 0);
 +      if (valid != NULL) if (valid->num_error != 0) {
 +              free_recipients(valid);
 +              valid = NULL;
 +      }
 +      if ( (valid == NULL) || (!strcasecmp(recipient, bouncesource)) ) {
-               strcpy(force_room, config.c_aideroom);
++              strcpy(force_room, CtdlGetConfigStr("c_aideroom"));
 +      }
 +      else {
 +              strcpy(force_room, "");
 +      }
 +      if ( (valid == NULL) && IsEmptyStr(force_room) ) {
++              strcpy(force_room, CtdlGetConfigStr("c_aideroom"));
 +      }
 +      CtdlSubmitMsg(msg, valid, force_room, 0);
 +
 +      /* Clean up */
 +      if (valid != NULL) free_recipients(valid);
 +      CM_Free(msg);
 +      QNM_syslog(LOG_DEBUG, "leaving network_bounce()\n");
 +}
 +
 +
  void ParseLastSent(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos, OneRoomNetCfg *OneRNCFG)
  {
        RoomNetCfgLine *nptr;
@@@ -454,8 -374,7 +454,8 @@@ void network_spoolout_room(SpoolContro
        }
        else
        {
 -              snprintf(buf, sizeof buf, "room_%s@%s", CCC->room.QRname, CtdlGetConfigStr("c_fqdn"));
 +              snprintf(buf, sizeof buf, "room_%s@%s",
-                        CCC->room.QRname, config.c_fqdn);
++                       CCC->room.QRname, CtdlGetConfigStr("c_fqdn"));
        }
  
        for (i=0; buf[i]; ++i) {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 9d4451309fd8e831bd3618b67779097a9b7efa8c,494dbeea9b8fdc196e1404b30584edc3488e57d4..d8b1ac9d2bd6b573806c92294731f0b81f4c1972
@@@ -2570,35 -2561,6 +2571,35 @@@ long CtdlSaveThisMessage(struct CtdlMes
        /* Free the memory we used for the serialized message */
        free(smr.ser);
  
-                                      config.c_fqdn
 +      return(retval);
 +}
 +
 +long send_message(struct CtdlMessage *msg) {
 +      long newmsgid;
 +      long retval;
 +      char msgidbuf[256];
 +      long msgidbuflen;
 +
 +      /* Get a new message number */
 +      newmsgid = get_new_message_number();
 +
 +      /* Generate an ID if we don't have one already */
 +      if (CM_IsEmpty(msg, emessageId)) {
 +              msgidbuflen = snprintf(msgidbuf, sizeof msgidbuf, "%08lX-%08lX@%s",
 +                                     (long unsigned int) time(NULL),
 +                                     (long unsigned int) newmsgid,
++                                     CtdlGetConfigStr("c_fqdn")
 +                      );
 +
 +              CM_SetField(msg, emessageId, msgidbuf, msgidbuflen);
 +      }
 +
 +      retval = CtdlSaveThisMessage(msg, newmsgid, 1);
 +
 +      if (retval == 0) {
 +              retval = newmsgid;
 +      }
 +
        /* Return the *local* message ID to the caller
         * (even if we're storing an incoming network message)
         */
Simple merge
index 6a7d293fb8ef7cf6265fa3b4e4d044b1d117a339,a8e272978d4f2904fa8f4447513b0bbc0618cc69..a015876e5beedd803790e92aa0dda78093a5825d
  #include "user_ops.h"
  #include "ecrash.h"
  
+ uid_t ctdluid = 0;
  const char *CitadelServiceUDS="citadel-UDS";
  const char *CitadelServiceTCP="citadel-TCP";
 +
 +
 +
  void go_threading(void);
  
  /*