From b7dc265b228b8da7a5beab3114ac1794fa7a813e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Fri, 16 Feb 2007 17:42:38 +0000 Subject: [PATCH] * handle =\r\n's in the qp decoder --- citadel/aidepost.c | 2 +- citadel/mime_parser.c | 7 ++++++- citadel/sendwelcomemail.sh | 13 ++++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/citadel/aidepost.c b/citadel/aidepost.c index 3e60dc976..71502756a 100644 --- a/citadel/aidepost.c +++ b/citadel/aidepost.c @@ -41,7 +41,7 @@ static void ap_make_message(FILE *fp, char *target_room, char *author) time_t now; time(&now); putc(255, fp); - putc(MES_NORMAL, fp); + putc(MT_RFC822, fp); putc(1, fp); fprintf(fp, "Proom_aide"); putc(0, fp); diff --git a/citadel/mime_parser.c b/citadel/mime_parser.c index c6415f34b..8e6912d39 100644 --- a/citadel/mime_parser.c +++ b/citadel/mime_parser.c @@ -72,7 +72,7 @@ int CtdlDecodeQuotedPrintable(char *decoded, char *encoded, int sourcelen) { char *check; decoded[0] = 0; - if (sourcelen >0) + if (sourcelen > 0) decoded[0] = encoded[0]; while (sourcepos <= sourcelen){ check = &decoded[destpos]; @@ -85,6 +85,11 @@ int CtdlDecodeQuotedPrintable(char *decoded, char *encoded, int sourcelen) { { decoded[destpos - 1] = '\0'; destpos-=2; + if ((sourcepos + 1 < sourcelen) && ( + (encoded[sourcepos + 1] == '\n') || + (encoded[sourcepos + 1] == '\r'))) + sourcepos ++; + } else if (sourcelen - sourcepos > 2) { diff --git a/citadel/sendwelcomemail.sh b/citadel/sendwelcomemail.sh index f1ac8c178..4b84325eb 100644 --- a/citadel/sendwelcomemail.sh +++ b/citadel/sendwelcomemail.sh @@ -7,9 +7,12 @@ export WELCOMETXT=welcomemail.txt export FROM=room_citadel_stats@uncensored.citadel.org export TO=room_lobby ( - printf "MIME-Version: 1.0\r\nContent-Type: multipart/alternative; \r\n boundary=$FOO\r\n\r\nThis is a multi-part message in MIME format.\r\n\r\n--$FOO\r\nContent-Type: text/plain; charset=utf-8\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n"; - cat $WELCOMETXT - printf "\r\n\r\n--$FOO\r\nContent-Type: text/html; charset=US-ASCII\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n" + printf "Subject: Welcome to your new citadel installation!\r\n" + printf "Content-Type: text/html MIME-Version: 1.0\r\n\r\n" cat $WELCOMEHTML; - printf "\r\n\r\n--$FOO--\r\n\r\n") | \ - citmail -bm -r "$FROM" "$TO" + +) | \ + ../aidepost -rLobby -aroom_citadel_support@uncensored.citadel.org + + +# citmail -bm -r "$FROM" "$TO" -- 2.39.2