utf8ify_rfc822_string() is in libcitadel now
authorArt Cancro <ajc@citadel.org>
Sun, 10 Jul 2022 23:09:54 +0000 (19:09 -0400)
committerArt Cancro <ajc@citadel.org>
Sun, 10 Jul 2022 23:09:54 +0000 (19:09 -0400)
23 files changed:
citadel/server/internet_addressing.c
citadel/server/modules/expire/serv_expire.c
libcitadel/Makefile.in
libcitadel/lib/array.c
libcitadel/lib/base64.c
libcitadel/lib/decode.c [new file with mode: 0644]
libcitadel/lib/hash.c
libcitadel/lib/html_to_ascii.c
libcitadel/lib/json.c
libcitadel/lib/libcitadel.c
libcitadel/lib/libcitadel.h
libcitadel/lib/mime_parser.c
libcitadel/lib/stringbuf.c
libcitadel/lib/tools.c
libcitadel/lib/urlhandling.c
libcitadel/lib/vcard.c
libcitadel/lib/vnote.c
webcit-ng/static/css/webcit.css
webcit-ng/static/index.html
webcit-ng/static/js/view_mail.js
webcit/Makefile.in
webcit/decode.c [deleted file]
webcit/webcit.h

index fa550d75fa4952edfa142f04dd7363249ac0e773..5acf8b781a38f7d876321cb1dc2c42c27cf68d9c 100644 (file)
 #include "parsedate.h"
 #include "database.h"
 #include "ctdl_module.h"
-#ifdef HAVE_ICONV
-#include <iconv.h>
 
-// This is the non-define version in case it is needed for debugging
-#if 0
-inline void FindNextEnd (char *bptr, char *end)
-{
-       /* Find the next ?Q? */
-       end = strchr(bptr + 2, '?');
-       if (end == NULL) return NULL;
-       if (((*(end + 1) == 'B') || (*(end + 1) == 'Q')) && 
-           (*(end + 2) == '?')) {
-               /* skip on to the end of the cluster, the next ?= */
-               end = strstr(end + 3, "?=");
-       }
-       else
-               /* sort of half valid encoding, try to find an end. */
-               end = strstr(bptr, "?=");
-}
-#endif
-
-#define FindNextEnd(bptr, end) { \
-       end = strchr(bptr + 2, '?'); \
-       if (end != NULL) { \
-               if (((*(end + 1) == 'B') || (*(end + 1) == 'Q')) && (*(end + 2) == '?')) { \
-                       end = strstr(end + 3, "?="); \
-               } else end = strstr(bptr, "?="); \
-       } \
-}
-
-// Handle subjects with RFC2047 encoding such as:
-// =?koi8-r?B?78bP0s3Mxc7JxSDXz9rE1dvO2c3JINvB0sHNySDP?=
-void utf8ify_rfc822_string(char *buf) {
-       char *start, *end, *next, *nextend, *ptr;
-       char newbuf[1024];
-       char charset[128];
-       char encoding[16];
-       char istr[1024];
-       iconv_t ic = (iconv_t)(-1) ;
-       char *ibuf;                     // Buffer of characters to be converted
-       char *obuf;                     // Buffer for converted characters
-       size_t ibuflen;                 // Length of input buffer
-       size_t obuflen;                 // Length of output buffer
-       char *isav;                     // Saved pointer to input buffer
-       char *osav;                     // Saved pointer to output buffer
-       int passes = 0;
-       int i, len, delta;
-       int illegal_non_rfc2047_encoding = 0;
-
-       // Sometimes, badly formed messages contain strings which were simply
-       // written out directly in some foreign character set instead of
-       // using RFC2047 encoding.  This is illegal but we will attempt to
-       // handle it anyway by converting from a user-specified default
-       // charset to UTF-8 if we see any nonprintable characters.
-       len = strlen(buf);
-       for (i=0; i<len; ++i) {
-               if ((buf[i] < 32) || (buf[i] > 126)) {
-                       illegal_non_rfc2047_encoding = 1;
-                       i = len;        // take a shortcut, it won't be more than one.
-               }
-       }
-       if (illegal_non_rfc2047_encoding) {
-               const char *default_header_charset = "iso-8859-1";
-               if ( (strcasecmp(default_header_charset, "UTF-8")) && (strcasecmp(default_header_charset, "us-ascii")) ) {
-                       ctdl_iconv_open("UTF-8", default_header_charset, &ic);
-                       if (ic != (iconv_t)(-1) ) {
-                               ibuf = malloc(1024);
-                               isav = ibuf;
-                               safestrncpy(ibuf, buf, 1024);
-                               ibuflen = strlen(ibuf);
-                               obuflen = 1024;
-                               obuf = (char *) malloc(obuflen);
-                               osav = obuf;
-                               iconv(ic, &ibuf, &ibuflen, &obuf, &obuflen);
-                               osav[1024-obuflen] = 0;
-                               strcpy(buf, osav);
-                               free(osav);
-                               iconv_close(ic);
-                               free(isav);
-                       }
-               }
-       }
-
-       // pre evaluate the first pair
-       nextend = end = NULL;
-       len = strlen(buf);
-       start = strstr(buf, "=?");
-       if (start != NULL) 
-               FindNextEnd (start, end);
-
-       while ((start != NULL) && (end != NULL)) {
-               next = strstr(end, "=?");
-               if (next != NULL)
-                       FindNextEnd(next, nextend);
-               if (nextend == NULL)
-                       next = NULL;
-
-               // did we find two partitions
-               if ((next != NULL) && ((next - end) > 2)) {
-                       ptr = end + 2;
-                       while ((ptr < next) && 
-                              (isspace(*ptr) ||
-                               (*ptr == '\r') ||
-                               (*ptr == '\n') || 
-                               (*ptr == '\t')))
-                               ptr ++;
-                       // did we find a gab just filled with blanks?
-                       if (ptr == next) {
-                               memmove(end + 2, next, len - (next - start));
-
-                               // now terminate the gab at the end
-                               delta = (next - end) - 2;
-                               len -= delta;
-                               buf[len] = '\0';
-
-                               // move next to its new location.
-                               next -= delta;
-                               nextend -= delta;
-                       }
-               }
-               // our next-pair is our new first pair now.
-               start = next;
-               end = nextend;
-       }
-
-       // Now we handle foreign character sets properly encoded in RFC2047 format.
-       start = strstr(buf, "=?");
-       FindNextEnd((start != NULL)? start : buf, end);
-       while (start != NULL && end != NULL && end > start) {
-               extract_token(charset, start, 1, '?', sizeof charset);
-               extract_token(encoding, start, 2, '?', sizeof encoding);
-               extract_token(istr, start, 3, '?', sizeof istr);
-
-               ibuf = malloc(1024);
-               isav = ibuf;
-               if (!strcasecmp(encoding, "B")) {       // base64
-                       ibuflen = CtdlDecodeBase64(ibuf, istr, strlen(istr));
-               }
-               else if (!strcasecmp(encoding, "Q")) {  // quoted-printable
-                       size_t len;
-                       unsigned long pos;
-                       
-                       len = strlen(istr);
-                       pos = 0;
-                       while (pos < len) {
-                               if (istr[pos] == '_') istr[pos] = ' ';
-                               pos++;
-                       }
-                       ibuflen = CtdlDecodeQuotedPrintable(ibuf, istr, len);
-               }
-               else {
-                       strcpy(ibuf, istr);             // unknown encoding
-                       ibuflen = strlen(istr);
-               }
-
-               ctdl_iconv_open("UTF-8", charset, &ic);
-               if (ic != (iconv_t)(-1) ) {
-                       obuflen = 1024;
-                       obuf = (char *) malloc(obuflen);
-                       osav = obuf;
-                       iconv(ic, &ibuf, &ibuflen, &obuf, &obuflen);
-                       osav[1024-obuflen] = 0;
-
-                       end = start;
-                       end++;
-                       strcpy(start, "");
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       strcpy(end, &end[1]);
-
-                       snprintf(newbuf, sizeof newbuf, "%s%s%s", buf, osav, end);
-                       strcpy(buf, newbuf);
-                       free(osav);
-                       iconv_close(ic);
-               }
-               else {
-                       end = start;
-                       end++;
-                       strcpy(start, "");
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       strcpy(end, &end[1]);
-
-                       snprintf(newbuf, sizeof newbuf, "%s(unreadable)%s", buf, end);
-                       strcpy(buf, newbuf);
-               }
-
-               free(isav);
-
-               // Since spammers will go to all sorts of absurd lengths to get their
-               // messages through, there are LOTS of corrupt headers out there.
-               // So, prevent a really badly formed RFC2047 header from throwing
-               // this function into an infinite loop.
-               ++passes;
-               if (passes > 20) return;
-
-               start = strstr(buf, "=?");
-               FindNextEnd((start != NULL)? start : buf, end);
-       }
-
-}
-#else
-inline void utf8ify_rfc822_string(char *a){};
-
-#endif
 
 
 char *inetcfg = NULL;
index ff1f9455276c42b9996aee4e6be081fbdd0b2bc5..e25a184487071c2006753c4d874e593fc33ca19e 100644 (file)
@@ -320,14 +320,13 @@ int PurgeRooms(void) {
        while (RoomPurgeList != NULL) {
                if (CtdlGetRoom(&qrbuf, RoomPurgeList->name) == 0) {
                        transcript=realloc(transcript, strlen(transcript)+SIZ);
-                       snprintf(&transcript[strlen(transcript)], SIZ, " %s\n",
-                               qrbuf.QRname);
+                       snprintf(&transcript[strlen(transcript)], SIZ, " %s\n", qrbuf.QRname);
                        CtdlDeleteRoom(&qrbuf);
+                       ++num_rooms_purged;
                }
                pptr = RoomPurgeList->next;
                free(RoomPurgeList);
                RoomPurgeList = pptr;
-               ++num_rooms_purged;
        }
 
        if (num_rooms_purged > 0) CtdlAideMessage(transcript, "Room Autopurger Message");
@@ -464,8 +463,7 @@ int PurgeUsers(void) {
                strcpy(transcript, "The following users have been auto-purged:\n");
                while (UserPurgeList != NULL) {
                        transcript=realloc(transcript, strlen(transcript)+SIZ);
-                       snprintf(&transcript[strlen(transcript)], SIZ, " %s\n",
-                               UserPurgeList->name);
+                       snprintf(&transcript[strlen(transcript)], SIZ, " %s\n", UserPurgeList->name);
                        purge_user(UserPurgeList->name);
                        pptr = UserPurgeList->next;
                        free(UserPurgeList);
@@ -503,7 +501,7 @@ int PurgeUsers(void) {
 // traverse the visit file, checking each record against those two lists and
 // purging the ones that do not have a match on _both_ lists.  (Remember, if
 // either the room or user being referred to is no longer on the system, the
-// record is completely useless.)
+// record is useless and should be removed.)
 //
 int PurgeVisits(void) {
        struct cdbdata *cdbvisit;
index 286d5418c24d2231300bee7eb2a226150a2b42af..6273e2c4157d91a79cc36c64e00c47388ed22717 100755 (executable)
@@ -115,6 +115,7 @@ LINK_CXX_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CXXCOMPILE) $(LDFLAGS) -o $@
 LIB_OBJS = lib/libcitadel.lo \
        lib/mime_parser.lo \
        lib/tools.lo \
+       lib/decode.lo \
        lib/base64.lo \
        lib/vcard.lo \
        lib/vnote.lo \
@@ -140,6 +141,7 @@ $(LIBRARY): $(LIB_OBJS)
 lib/libcitadel.lo: lib/libcitadel.c lib/libcitadel.h
 lib/mime_parser.lo: lib/mime_parser.c lib/libcitadel.h
 lib/tools.lo: lib/tools.c lib/libcitadel.h
+lib/decode.lo: lib/decode.c lib/libcitadel.h
 lib/base64.lo: lib/base64.c lib/libcitadel.h
 lib/vcard.lo: lib/vcard.c lib/libcitadel.h
 lib/vnote.lo: lib/vnote.c lib/libcitadel.h
@@ -156,6 +158,7 @@ lib/xdgmime/xdgmimeparent.lo:  lib/xdgmime/xdgmimeparent.c
 lib/xdgmime/xdgmimecache.lo: lib/xdgmime/xdgmimecache.c
 lib/html_to_ascii.lo: lib/html_to_ascii.c
 lib/tools.lo: lib/tools.c
+lib/decode.lo: lib/decode.c
 lib/base64.lo: lib/base64.c
 
 .SUFFIXES: .c .cpp .lo .o
index 1adc1fde8f39f078464b3fdbb486e4930028bfd1..daed5a3aa1b9c897982816debe5cfa0025c97c0e 100644 (file)
@@ -5,19 +5,8 @@
  *
  * Copyright (c) 2021 by Art Cancro
  *
- * 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
- * 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
+ * This program is open source software.  Use, duplication, or disclosure
+ * is subject to the terms of the GNU General Public License, version 3.
  */
 
 
index a7be64d9a2834a146076de9dbddda2786c8deb2e..ef1e01e714124f1fdd35c64a51d2fd3e7511b89e 100644 (file)
@@ -7,19 +7,9 @@
 //
 // Copyright (c) 1987-2022 by the citadel.org team
 //
-// 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
-// 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
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
+
 
 #define _GNU_SOURCE
 #include "sysdep.h"
@@ -101,7 +91,7 @@ size_t CtdlEncodeBase64(char *dest, const char *source, size_t sourcelen, int li
 
 
 // convert base64 alphabet characters to 6-bit decimal values
-char unalphabet(char ch) {
+char b64unalphabet(char ch) {
        if (isupper(ch)) {
                return(ch - 'A');
        }
@@ -139,7 +129,7 @@ size_t CtdlDecodeBase64(char *dest, const char *source, size_t source_len) {
 
        while (bytes_read < source_len) {
 
-               char ch = unalphabet(source[bytes_read++]);
+               char ch = b64unalphabet(source[bytes_read++]);
                if (ch < 65) {
                        decodebuf[decodepos++] = ch;
                }
diff --git a/libcitadel/lib/decode.c b/libcitadel/lib/decode.c
new file mode 100644 (file)
index 0000000..10bde0c
--- /dev/null
@@ -0,0 +1,226 @@
+// Copyright (c) 1996-2022 by the citadel.org team
+//
+// This program is open source software.  Use, duplication, or disclosure
+// are subject to the terms of the GNU General Public License v3.
+
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <ctype.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <limits.h>
+#include <iconv.h>
+#include "libcitadel.h"
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#endif
+
+
+// This is the non-define version in case it is needed for debugging
+#if 0
+inline void FindNextEnd (char *bptr, char *end) {
+       /* Find the next ?Q? */
+       end = strchr(bptr + 2, '?');
+       if (end == NULL) return NULL;
+       if (((*(end + 1) == 'B') || (*(end + 1) == 'Q')) && 
+           (*(end + 2) == '?')) {
+               /* skip on to the end of the cluster, the next ?= */
+               end = strstr(end + 3, "?=");
+       }
+       else
+               /* sort of half valid encoding, try to find an end. */
+               end = strstr(bptr, "?=");
+}
+#endif
+
+#define FindNextEnd(bptr, end) { \
+       end = strchr(bptr + 2, '?'); \
+       if (end != NULL) { \
+               if (((*(end + 1) == 'B') || (*(end + 1) == 'Q')) && (*(end + 2) == '?')) { \
+                       end = strstr(end + 3, "?="); \
+               } else end = strstr(bptr, "?="); \
+       } \
+}
+
+// Handle subjects with RFC2047 encoding such as:
+// =?koi8-r?B?78bP0s3Mxc7JxSDXz9rE1dvO2c3JINvB0sHNySDP?=
+void utf8ify_rfc822_string(char *buf) {
+       char *start, *end, *next, *nextend, *ptr;
+       char newbuf[1024];
+       char charset[128];
+       char encoding[16];
+       char istr[1024];
+       iconv_t ic = (iconv_t)(-1) ;
+       char *ibuf;                     // Buffer of characters to be converted
+       char *obuf;                     // Buffer for converted characters
+       size_t ibuflen;                 // Length of input buffer
+       size_t obuflen;                 // Length of output buffer
+       char *isav;                     // Saved pointer to input buffer
+       char *osav;                     // Saved pointer to output buffer
+       int passes = 0;
+       int i, len, delta;
+       int illegal_non_rfc2047_encoding = 0;
+
+       // Sometimes, badly formed messages contain strings which were simply
+       // written out directly in some foreign character set instead of
+       // using RFC2047 encoding.  This is illegal but we will attempt to
+       // handle it anyway by converting from a user-specified default
+       // charset to UTF-8 if we see any nonprintable characters.
+       len = strlen(buf);
+       for (i=0; i<len; ++i) {
+               if ((buf[i] < 32) || (buf[i] > 126)) {
+                       illegal_non_rfc2047_encoding = 1;
+                       i = len;        // take a shortcut, it won't be more than one.
+               }
+       }
+       if (illegal_non_rfc2047_encoding) {
+               const char *default_header_charset = "iso-8859-1";
+               if ( (strcasecmp(default_header_charset, "UTF-8")) && (strcasecmp(default_header_charset, "us-ascii")) ) {
+                       ctdl_iconv_open("UTF-8", default_header_charset, &ic);
+                       if (ic != (iconv_t)(-1) ) {
+                               ibuf = malloc(1024);
+                               isav = ibuf;
+                               safestrncpy(ibuf, buf, 1024);
+                               ibuflen = strlen(ibuf);
+                               obuflen = 1024;
+                               obuf = (char *) malloc(obuflen);
+                               osav = obuf;
+                               iconv(ic, &ibuf, &ibuflen, &obuf, &obuflen);
+                               osav[1024-obuflen] = 0;
+                               strcpy(buf, osav);
+                               free(osav);
+                               iconv_close(ic);
+                               free(isav);
+                       }
+               }
+       }
+
+       // pre evaluate the first pair
+       nextend = end = NULL;
+       len = strlen(buf);
+       start = strstr(buf, "=?");
+       if (start != NULL) 
+               FindNextEnd (start, end);
+
+       while ((start != NULL) && (end != NULL)) {
+               next = strstr(end, "=?");
+               if (next != NULL)
+                       FindNextEnd(next, nextend);
+               if (nextend == NULL)
+                       next = NULL;
+
+               // did we find two partitions
+               if ((next != NULL) && ((next - end) > 2)) {
+                       ptr = end + 2;
+                       while ((ptr < next) && 
+                              (isspace(*ptr) ||
+                               (*ptr == '\r') ||
+                               (*ptr == '\n') || 
+                               (*ptr == '\t')))
+                               ptr ++;
+                       // did we find a gab just filled with blanks?
+                       if (ptr == next) {
+                               memmove(end + 2, next, len - (next - start));
+
+                               // now terminate the gab at the end
+                               delta = (next - end) - 2;
+                               len -= delta;
+                               buf[len] = '\0';
+
+                               // move next to its new location.
+                               next -= delta;
+                               nextend -= delta;
+                       }
+               }
+               // our next-pair is our new first pair now.
+               start = next;
+               end = nextend;
+       }
+
+       // Now we handle foreign character sets properly encoded in RFC2047 format.
+       start = strstr(buf, "=?");
+       FindNextEnd((start != NULL)? start : buf, end);
+       while (start != NULL && end != NULL && end > start) {
+               extract_token(charset, start, 1, '?', sizeof charset);
+               extract_token(encoding, start, 2, '?', sizeof encoding);
+               extract_token(istr, start, 3, '?', sizeof istr);
+
+               ibuf = malloc(1024);
+               isav = ibuf;
+               if (!strcasecmp(encoding, "B")) {       // base64
+                       ibuflen = CtdlDecodeBase64(ibuf, istr, strlen(istr));
+               }
+               else if (!strcasecmp(encoding, "Q")) {  // quoted-printable
+                       size_t len;
+                       unsigned long pos;
+                       
+                       len = strlen(istr);
+                       pos = 0;
+                       while (pos < len) {
+                               if (istr[pos] == '_') istr[pos] = ' ';
+                               pos++;
+                       }
+                       ibuflen = CtdlDecodeQuotedPrintable(ibuf, istr, len);
+               }
+               else {
+                       strcpy(ibuf, istr);             // unknown encoding
+                       ibuflen = strlen(istr);
+               }
+
+               ctdl_iconv_open("UTF-8", charset, &ic);
+               if (ic != (iconv_t)(-1) ) {
+                       obuflen = 1024;
+                       obuf = (char *) malloc(obuflen);
+                       osav = obuf;
+                       iconv(ic, &ibuf, &ibuflen, &obuf, &obuflen);
+                       osav[1024-obuflen] = 0;
+
+                       end = start;
+                       end++;
+                       strcpy(start, "");
+                       remove_token(end, 0, '?');
+                       remove_token(end, 0, '?');
+                       remove_token(end, 0, '?');
+                       remove_token(end, 0, '?');
+                       strcpy(end, &end[1]);
+
+                       snprintf(newbuf, sizeof newbuf, "%s%s%s", buf, osav, end);
+                       strcpy(buf, newbuf);
+                       free(osav);
+                       iconv_close(ic);
+               }
+               else {
+                       end = start;
+                       end++;
+                       strcpy(start, "");
+                       remove_token(end, 0, '?');
+                       remove_token(end, 0, '?');
+                       remove_token(end, 0, '?');
+                       remove_token(end, 0, '?');
+                       strcpy(end, &end[1]);
+
+                       snprintf(newbuf, sizeof newbuf, "%s(unreadable)%s", buf, end);
+                       strcpy(buf, newbuf);
+               }
+
+               free(isav);
+
+               // Since spammers will go to all sorts of absurd lengths to get their
+               // messages through, there are LOTS of corrupt headers out there.
+               // So, prevent a really badly formed RFC2047 header from throwing
+               // this function into an infinite loop.
+               ++passes;
+               if (passes > 20) return;
+
+               start = strstr(buf, "=?");
+               FindNextEnd((start != NULL)? start : buf, end);
+       }
+
+}
index 665e39b304cd43bf81127a26a9f2d9106b14bfa0..996293147c5627a1633676816cd43f89e4b805f1 100644 (file)
@@ -1,19 +1,8 @@
 /*
  * Copyright (c) 1987-2011 by the citadel.org team
  *
- * 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
- * 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
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
  */
 
 #include <stdint.h>
index 45beb2cbb079b97eeaa2041df905e8676ce3145a..d325e4a896c0523a3d3ba61293445cd9705e4fd7 100644 (file)
@@ -2,19 +2,8 @@
  * Functions which handle translation between HTML and plain text
  * Copyright (c) 2000-2018 by the citadel.org team
  *
- * 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
- * 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
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
  */
 
 #include <stdlib.h>
index 7f611818f8712169d16786d0bf3be7437cf30e68..0b3a7d16ff64e69b9c3bf78cd926ce7da9f093d2 100644 (file)
@@ -3,19 +3,8 @@
  *
  * Copyright (c) 1987-2018 by the citadel.org team
  *
- * 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
- * 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
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
  */
 
 #include "sysdep.h"
index 2713887cc03880b5ead1a5e2c2ff2fe66c026311..bc88219ff0b0966e266e051ceea4d23ae41f8a1c 100644 (file)
@@ -3,19 +3,8 @@
  *
  * Copyright (c) 1987-2013 by the citadel.org team
  *
- * 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
- * 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
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
  */
 
 #include <stdlib.h>
index 362e69e4c3be11b212d5298d6171afd43adc0a82..b6e9cb1f89ce0ea6138a60baa7d00ef90890aa0a 100644 (file)
@@ -1,15 +1,10 @@
 /*
  * Header file for libcitadel
  *
- * Copyright (c) 1987-2021 by the citadel.org team
+ * Copyright (c) 1987-2022 by the citadel.org team
  *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3.
- *
- * 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.
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
  */
 
 /* protect against double includes */
@@ -440,6 +435,7 @@ int pattern2(char *search, char *patn);
 void stripltlen(char *, int *);
 char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth);
 void LoadEntityList(char *FileName);
+void utf8ify_rfc822_string(char *buf);
 
 
 typedef struct {
index 105d29a39c0297681a6550093ad9981c6a845e3e..318c23fdebc30a1b96446bac2994764e44e78158 100644 (file)
@@ -2,19 +2,8 @@
 //
 // Copyright (c) 1998-2022 by the citadel.org development team.
 //
-// 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
-// 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
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
 
 #include <stdlib.h>
 #include <unistd.h>
index 3d8b3010d914a096c893177f37eb7604153014b6..8023ab7c7166c0feb54d109a80b692188c442361 100644 (file)
@@ -1,18 +1,7 @@
 // Copyright (c) 1987-2022 by the citadel.org team
 //
-// 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
-// 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
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
 
 #define _GNU_SOURCE
 #include "sysdep.h"
index 20dd1e926dc0887989a5b08c93192c7e194b6867..53151fb950565a0d0500cced540c27c86efd80a2 100644 (file)
@@ -3,20 +3,8 @@
 //
 // Copyright (c) 1987-2022 by the citadel.org team
 //
-// 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
-// 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
-
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
 
 #include <stdlib.h>
 #include <unistd.h>
index 8896770eea84ce4755eaf3aad5864d78b070091f..7d53f9bdb83701b20f597ae7e49304335bbdea3d 100644 (file)
@@ -1,3 +1,5 @@
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
 #include "sysdep.h"
 #include <ctype.h>
 #include <errno.h>
index f12a4efb599642dd7a2931de9e0c58fce25869fb..f52bb29c49f5ba14ac66b93734ee82545396eb05 100644 (file)
@@ -3,19 +3,8 @@
  *
  * Copyright (C) 1999-2008 by the citadel.org development team.
  *
- * 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
- * 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
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
  */
 
 
index feeee928915a3bf008e71d6a112ec3364760700e..7f50026776d1670342d8925cbc8d3fab20d1acab 100644 (file)
@@ -3,19 +3,8 @@
  *
  * Copyright (C) 1999-2007 by the citadel.org development team.
  *
- * 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
- * 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
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
  */
 
 
index 3b3abd753b58f71990dc33e006a37ed52cacfa6a..5c1b15b33422b1e678cc0620c34aaecce38d2fbb 100644 (file)
@@ -191,8 +191,25 @@ blockquote pre {
 .ctdl-roomlist-mtime {
 }
 
+.ctdl-mailbox-heading {
+       position: sticky;
+       top: 0;
+       z-index: 6;
+}
+
 .ctdl-mailbox-pane {           /* list of messages when in mailbox view */
+       position: absolute;
+       height: 25%;
+       width: inherit;
+       overflow-x: hidden;
+       overflow-y: scroll;
 }
 
 .ctdl-reading-pane {           /* message reading/composing pane when in mailbox view */
+       position: absolute;
+       top: 31%;
+       height: 70%;
+       left: inherit;
+       right: inherit;
+       overflow: scroll;
 }
index 78acd2865ae539e209b2bcbeffd99c7a9b19f9b8..9582c46dba5fb8751f17796c5996f218e13f8f01 100644 (file)
@@ -17,7 +17,7 @@
 <body class="w3-light-grey">
 
 <!-- Modal dialog (when needed) -->
-<div id="ctdl_big_modal" class="w3-modal" style="display:none; z-index:5">
+<div id="ctdl_big_modal" class="w3-modal" style="display:none; z-index:9">
 LOADING
 </div>
 
index eef879c566d11fbe3efac67e0235888e82782f80..535d0f1f793875d5aca2c4e542e3fb02b8933444 100644 (file)
@@ -130,9 +130,10 @@ function mail_render_row(msg) {
 
 // Set up the mailbox view
 function mail_display() {
-       document.getElementById("ctdl-main").innerHTML =
-               "<div id=\"ctdl-mailbox-pane\" class=\"ctdl-mailbox-pane\"></div>"
+       document.getElementById("ctdl-main").innerHTML
+               "<div id=\"ctdl-mailbox-pane\" class=\"ctdl-mailbox-pane\"></div>"
                + "<div id=\"ctdl-reading-pane\" class=\"ctdl-reading-pane\"></div>";
+       ;
        refresh_mail_display();
        try {                                                   // if this was already set up, clear it so there aren't multiple
                clearInterval(RefreshMailboxInterval);
@@ -166,7 +167,7 @@ function refresh_mail_display() {
                if (response.ok) {
 
                        box =   "<table class=\"w3-table-all w3-hoverable\" width=100%>"
-                               + "<tr class=\"w3-blue\">"
+                               + "<tr class=\"ctdl-mailbox-heading w3-blue\">"
                                + "<th>" + _("Subject") + "</th>"
                                + "<th>" + _("Sender") + "</th>"
                                + "<th>" + _("Date") + "</th>"
index c27aadab7d98add65c611515a7a2a4bfd8b69649..1e11235b40c45c65ab8fbb7c7f63eee0b233ed88 100644 (file)
@@ -63,7 +63,7 @@ webcit: webserver.o context_loop.o ical_dezonify.o \
        dav_options.o autocompletion.o gettext.o tabs.o sieve.o sitemap.o \
        dav_delete.o dav_put.o http_datestring.o \
        downloads.o addressbook_popup.o pushemail.o sysdep.o openid.o \
-       decode.o modules_init.o paramhandling.o utils.o \
+       modules_init.o paramhandling.o utils.o \
        ical_maps.o ical_subst.o static.o feed_generator.o \
        $(LIBOBJS)
        echo LD: webcit
@@ -80,7 +80,7 @@ webcit: webserver.o context_loop.o ical_dezonify.o \
        dav_main.o dav_get.o dav_propfind.o dav_report.o dav_delete.o \
        dav_options.o autocompletion.o tabs.o smtpqueue.o sieve.o sitemap.o \
        dav_put.o http_datestring.o fmt_date.o modules_init.o \
-       gettext.o downloads.o addressbook_popup.o pushemail.o sysdep.o decode.o \
+       gettext.o downloads.o addressbook_popup.o pushemail.o sysdep.o \
        paramhandling.o utils.o ical_maps.o ical_subst.o static.o feed_generator.o \
        $(LIBS)
 
diff --git a/webcit/decode.c b/webcit/decode.c
deleted file mode 100644 (file)
index cf1f4ae..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * Copyright (c) 1996-2012 by the citadel.org team
- *
- * This program is open source software.  You can redistribute it and/or
- * modify it under the terms of the GNU General Public License, version 3.
- *
- * 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.
- */
-
-#include "webcit.h"
-#ifdef HAVE_ICONV
-
-/*
- * Wrapper around iconv_open()
- * Our version adds aliases for non-standard Microsoft charsets
- * such as 'MS950', aliasing them to names like 'CP950'
- *
- * tocode      Target encoding
- * fromcode    Source encoding
- * /
-iconv_t ctdl_iconv_open(const char *tocode, const char *fromcode)
-{
-       iconv_t ic = (iconv_t)(-1) ;
-       ic = iconv_open(tocode, fromcode);
-       if (ic == (iconv_t)(-1) ) {
-               char alias_fromcode[64];
-               if ( (strlen(fromcode) == 5) && (!strncasecmp(fromcode, "MS", 2)) ) {
-                       safestrncpy(alias_fromcode, fromcode, sizeof alias_fromcode);
-                       alias_fromcode[0] = 'C';
-                       alias_fromcode[1] = 'P';
-                       ic = iconv_open(tocode, alias_fromcode);
-               }
-       }
-       return(ic);
-}
-*/
-
-
-static inline char *FindNextEnd (char *bptr)
-{
-       char * end;
-       /* Find the next ?Q? */
-       end = strchr(bptr + 2, '?');
-       if (end == NULL) return NULL;
-       if (((*(end + 1) == 'B') || (*(end + 1) == 'Q')) && 
-           (*(end + 2) == '?')) {
-               /* skip on to the end of the cluster, the next ?= */
-               end = strstr(end + 3, "?=");
-       }
-       else
-               /* sort of half valid encoding, try to find an end. */
-               end = strstr(bptr, "?=");
-       return end;
-}
-
-/*
- * Handle subjects with RFC2047 encoding such as:
- * =?koi8-r?B?78bP0s3Mxc7JxSDXz9rE1dvO2c3JINvB0sHNySDP?=
- */
-void utf8ify_rfc822_string(char **buf) {
-       char *start, *end, *next, *nextend, *ptr;
-       char newbuf[1024];
-       char charset[128];
-       char encoding[16];
-       char istr[1024];
-       iconv_t ic = (iconv_t)(-1) ;
-       char *ibuf;                     /* Buffer of characters to be converted */
-       char *obuf;                     /* Buffer for converted characters */
-       size_t ibuflen;                 /* Length of input buffer */
-       size_t obuflen;                 /* Length of output buffer */
-       char *isav;                     /* Saved pointer to input buffer */
-       char *osav;                     /* Saved pointer to output buffer */
-       int passes = 0;
-       int i, len, delta;
-       int illegal_non_rfc2047_encoding = 0;
-
-       /* Sometimes, badly formed messages contain strings which were simply
-        *  written out directly in some foreign character set instead of
-        *  using RFC2047 encoding.  This is illegal but we will attempt to
-        *  handle it anyway by converting from a user-specified default
-        *  charset to UTF-8 if we see any nonprintable characters.
-        */
-       len = strlen(*buf);
-       for (i=0; i<len; ++i) {
-               if (((*buf)[i] < 32) || ((*buf)[i] > 126)) {
-                       illegal_non_rfc2047_encoding = 1;
-                       i = len; /*< take a shortcut, it won't be more than one. */
-               }
-       }
-       if (illegal_non_rfc2047_encoding) {
-               StrBuf *default_header_charset;
-               get_preference("default_header_charset", &default_header_charset);
-               if ( (strcasecmp(ChrPtr(default_header_charset), "UTF-8")) && 
-                    (strcasecmp(ChrPtr(default_header_charset), "us-ascii")) ) {
-                       ctdl_iconv_open("UTF-8", ChrPtr(default_header_charset), &ic);
-                       if (ic != (iconv_t)(-1) ) {
-                               ibuf = malloc(1024);
-                               isav = ibuf;
-                               safestrncpy(ibuf, *buf, 1023);
-                               ibuflen = strlen(ibuf);
-                               obuflen = 1024;
-                               obuf = (char *) malloc(obuflen);
-                               osav = obuf;
-                               iconv(ic, &ibuf, &ibuflen, &obuf, &obuflen);
-                               osav[1023-obuflen] = 0;
-                               free(*buf);
-                               *buf = osav;
-                               iconv_close(ic);
-                               free(isav);
-                       }
-               }
-       }
-
-       /* pre evaluate the first pair */
-       nextend = end = NULL;
-       len = strlen(*buf);
-       start = strstr(*buf, "=?");
-       if (start != NULL) 
-               end = FindNextEnd (start);
-
-       while ((start != NULL) && (end != NULL))
-       {
-               next = strstr(end, "=?");
-               if (next != NULL)
-                       nextend = FindNextEnd(next);
-               if (nextend == NULL)
-                       next = NULL;
-
-               /* did we find two partitions */
-               if ((next != NULL) && 
-                   ((next - end) > 2))
-               {
-                       ptr = end + 2;
-                       while ((ptr < next) && 
-                              (isspace(*ptr) ||
-                               (*ptr == '\r') ||
-                               (*ptr == '\n') || 
-                               (*ptr == '\t')))
-                               ptr ++;
-                       /* did we find a gab just filled with blanks? */
-                       if (ptr == next)
-                       {
-                               memmove (end + 2,
-                                        next,
-                                        len - (next - start));
-
-                               /* now terminate the gab at the end */
-                               delta = (next - end) - 2;
-                               len -= delta;
-                               (*buf)[len] = '\0';
-
-                               /* move next to its new location. */
-                               next -= delta;
-                               nextend -= delta;
-                       }
-               }
-               /* our next-pair is our new first pair now. */
-               start = next;
-               end = nextend;
-       }
-
-       /* Now we handle foreign character sets properly encoded
-        * in RFC2047 format.
-        */
-       while (start=strstr((*buf), "=?"), end=FindNextEnd((start != NULL)? start : (*buf)),
-               ((start != NULL) && (end != NULL) && (end > start)) )
-       {
-               extract_token(charset, start, 1, '?', sizeof charset);
-               extract_token(encoding, start, 2, '?', sizeof encoding);
-               extract_token(istr, start, 3, '?', sizeof istr);
-
-               ibuf = malloc(1024);
-               isav = ibuf;
-               if (!strcasecmp(encoding, "B")) {       /* base64 */
-                       ibuflen = CtdlDecodeBase64(ibuf, istr, strlen(istr));
-               }
-               else if (!strcasecmp(encoding, "Q")) {  /* quoted-printable */
-                       size_t len;
-                       long pos;
-                       
-                       len = strlen(istr);
-                       pos = 0;
-                       while (pos < len)
-                       {
-                               if (istr[pos] == '_') istr[pos] = ' ';
-                               pos++;
-                       }
-
-                       ibuflen = CtdlDecodeQuotedPrintable(ibuf, istr, len);
-               }
-               else {
-                       strcpy(ibuf, istr);             /* unknown encoding */
-                       ibuflen = strlen(istr);
-               }
-
-               ctdl_iconv_open("UTF-8", charset, &ic);
-               if (ic != (iconv_t)(-1) ) {
-                       obuflen = 1024;
-                       obuf = (char *) malloc(obuflen);
-                       osav = obuf;
-                       iconv(ic, &ibuf, &ibuflen, &obuf, &obuflen);
-                       osav[1024-obuflen] = 0;
-
-                       end = start;
-                       end++;
-                       strcpy(start, "");
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       strcpy(end, &end[1]);
-
-                       snprintf(newbuf, sizeof newbuf, "%s%s%s", *buf, osav, end);
-                       strcpy(*buf, newbuf);
-                       
-                       free(osav);
-                       iconv_close(ic);
-               }
-               else {
-                       end = start;
-                       end++;
-                       strcpy(start, "");
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       remove_token(end, 0, '?');
-                       strcpy(end, &end[1]);
-
-                       snprintf(newbuf, sizeof newbuf, "%s(unreadable)%s", *buf, end);
-                       strcpy(*buf, newbuf);
-               }
-
-               free(isav);
-
-               /*
-                * Since spammers will go to all sorts of absurd lengths to get their
-                * messages through, there are LOTS of corrupt headers out there.
-                * So, prevent a really badly formed RFC2047 header from throwing
-                * this function into an infinite loop.
-                */
-               ++passes;
-               if (passes > 20) return;
-       }
-
-}
-#else
-inline void utf8ify_rfc822_string(char **a){};
-
-#endif
-
-
-
-
-/*
- * RFC2047-encode a header field if necessary.
- * If no non-ASCII characters are found, the string will be copied verbatim without encoding.
- * Returns encoded length; -1 if non success.
- *
- * target              Target buffer.
- * maxlen              Maximum size of target buffer.
- * source              Source string to be encoded.
- * SourceLen           Length of the source string
- */
-int webcit_rfc2047encode(char *target, int maxlen, char *source, long SourceLen)
-{
-       const char headerStr[] = "=?UTF-8?Q?";
-       int need_to_encode = 0;
-       int i = 0;
-       int len;
-       unsigned char ch;
-
-       if ((source == NULL) || 
-           (target == NULL) ||
-           (SourceLen > maxlen)) return -1;
-
-       while ((!IsEmptyStr (&source[i])) && 
-              (need_to_encode == 0) &&
-              (i < SourceLen) ) {
-               if (((unsigned char) source[i] < 32) || 
-                   ((unsigned char) source[i] > 126)) {
-                       need_to_encode = 1;
-               }
-               i++;
-       }
-
-       if (!need_to_encode) {
-               memcpy (target, source, SourceLen);
-               target[SourceLen] = '\0';
-               return SourceLen;
-       }
-       
-       if (sizeof (headerStr + SourceLen + 2) > maxlen)
-               return -1;
-       memcpy (target, headerStr, sizeof (headerStr));
-       len = sizeof (headerStr) - 1;
-       for (i=0; (i < SourceLen) && (len + 3< maxlen) ; ++i) {
-               ch = (unsigned char) source[i];
-               if ((ch < 32) || (ch > 126) || (ch == 61)) {
-                       sprintf(&target[len], "=%02X", ch);
-                       len += 3;
-               }
-               else {
-                       sprintf(&target[len], "%c", ch);
-                       len ++;
-               }
-       }
-       
-       if (len + 2 < maxlen) {
-               strcat(&target[len], "?=");
-               len +=2;
-               return len;
-       }
-       else
-               return -1;
-}
-
index c7b7d15eb8671ca6dea8170775e2be61820ea767..a5adb52fd4b89687d843980bbcb4c333580f3297 100644 (file)
@@ -621,7 +621,7 @@ void TmplGettext(StrBuf *Target, WCTemplputParams *TP); /* actual supported loca
 void set_selected_language(const char *);
 void go_selected_language(void);
 const char *get_selected_language(void);
-void utf8ify_rfc822_string(char **buf);
+// void utf8ify_rfc822_string(char **buf); this is in libcitadel now
 void begin_burst(void);
 long end_burst(void);
 void AppendImportantMessage(const char *pch, long len);