Changed how Message-ID RFC2822 field is generated master
authorArt Cancro <ajc@citadel.org>
Fri, 19 Apr 2024 02:45:52 +0000 (02:45 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 19 Apr 2024 02:45:52 +0000 (02:45 +0000)
citadel/server/msgbase.c
webcit/bootstrap
webcit/configure.ac

index b3a8f7071c66a9a3ee651dcc2e9feba089886e68..8582fba301bed1b1f50209c45b5384ec34a04187 100644 (file)
@@ -2011,12 +2011,13 @@ int CtdlOutputPreLoadedMsg(
        }
 
        if (mode == MT_RFC822) {
-               // Construct a fun message id
-               cprintf("Message-ID: <%s", mid);
-               if (strchr(mid, '@')==NULL) {
-                       cprintf("@%s", snode);
-               }
-               cprintf(">%s", nl);
+               // Make the message ID RFC2822 compliant
+               cprintf("Message-ID: <%s%s%s>%s",               // put it in angle brackets
+                       mid,
+                       (strchr(mid, '@') ? "" : "@"),          // if there is no domain part,
+                       (strchr(mid, '@') ? "" : snode),        // tack on ours.
+                       nl
+               );
 
                if (!is_room_aide() && (TheMessage->cm_anon_type == MES_ANONONLY)) {
                        cprintf("From: \"----\" <x@x.org>%s", nl);
@@ -2320,7 +2321,7 @@ long CtdlSaveThisMessage(struct CtdlMessage *msg, long msgid) {
        }
 
        if (error_count > 0) {
-               syslog(LOG_ERR, "msgbase: encountered %d errors storing message %ld", error_count, msgid);
+               syslog(LOG_ERR, "msgbase: encountered %ld errors storing message %ld", error_count, msgid);
        }
 
        // Free the memory we used for the serialized message
index 43c30e3c2e582ef2cfd92ce23d081bf4f5fd8286..2942bace5b352f77779524148f301cffdf6ee146 100755 (executable)
@@ -6,6 +6,8 @@
 # Remove any vestiges of pre-6.05 build environments
 rm -f .libs modules *.so *.lo *.la 2>/dev/null
 
+grep '^#define CLIENT_VERSION' webcit.h | sed 's/[^0-9]*//g' >package-version.txt
+
 echo ... running aclocal ...
 aclocal
     
@@ -23,7 +25,6 @@ autoheader
 echo ... mk_module_init.sh ...
 ./scripts/mk_module_init.sh
 
-
 echo
 echo This script has been tested with autoconf 2.53 and
 echo automake 1.5. Other versions may work, but I recommend the latest
@@ -33,4 +34,3 @@ echo Also note that autoconf and automake should be configured
 echo with the same prefix.
 echo
 
-grep '^#define CLIENT_VERSION' webcit.h | sed 's/[^0-9]*//g' >package-version.txt
index 2ca5796b27be7fbdcc2fa21d4f655d644c81bd49..7ffaf142b725358974f64827c141f4055b5aae74 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
-AC_INIT([WebCit],[m4_esyscmd_s(grep CLIENT_VERSION webcit.h | sed 's/[^0-9]*//g')],[http://uncensored.citadel.org])
+AC_INIT([WebCit],[m4_esyscmd_s(cat package-version.txt)],[http://uncensored.citadel.org])
 
 AC_SUBST(PROG_SUBDIRS)
 AC_DEFINE(PROG_SUBDIRS, [], [Program dirs])