summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-04-20 02:36:10 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-04-20 02:36:10 +0800
commit4a9404f7b751584fed9234b10e3cc2f0b9c4fc70 (patch)
tree8657238f92cb5bd7ce348c4b1594fa85fcb53f10
parent5e20661237dc3008488af49ea04d295884b6bf93 (diff)
downloadpttbbs-4a9404f7b751584fed9234b10e3cc2f0b9c4fc70.tar
pttbbs-4a9404f7b751584fed9234b10e3cc2f0b9c4fc70.tar.gz
pttbbs-4a9404f7b751584fed9234b10e3cc2f0b9c4fc70.tar.bz2
pttbbs-4a9404f7b751584fed9234b10e3cc2f0b9c4fc70.tar.lz
pttbbs-4a9404f7b751584fed9234b10e3cc2f0b9c4fc70.tar.xz
pttbbs-4a9404f7b751584fed9234b10e3cc2f0b9c4fc70.tar.zst
pttbbs-4a9404f7b751584fed9234b10e3cc2f0b9c4fc70.zip
add mail header: Mime-Version, Content-Type, Content-Transfer-Encoding
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@803 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--util/outmail.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/util/outmail.c b/util/outmail.c
index 804638e5..d8efb526 100644
--- a/util/outmail.c
+++ b/util/outmail.c
@@ -1,4 +1,4 @@
-/* $Id: outmail.c,v 1.4 2002/09/03 07:09:34 in2 Exp $ */
+/* $Id: outmail.c,v 1.5 2003/04/19 18:36:10 in2 Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -155,10 +155,18 @@ void doSendBody(int sock, FILE *fp, char *from, char *to, char *subject) {
int n;
char buf[2048];
- n = snprintf(buf, sizeof(buf), "From: %s\nTo: %s\nSubject: %s\n\n",
+ n = snprintf(buf, sizeof(buf),
+ "From: %s\r\n"
+ "To: %s\r\n"
+ "Subject: %s\r\n"
+ "X-Sender: outmail of pttbbs\r\n"
+ "Mime-Version: 1.0\r\n"
+ "Content-Type: text/plain; charset=\"big5\"\r\n"
+ "Content-Transfer-Encoding: 8bit\r\n"
+ "X-Disclaimer: [" BBSNAME "]對本信內容恕不負責\r\n\r\n",
from, to, subject);
write(sock, buf, n);
-
+
while(fgets(buf, sizeof(buf), fp)) {
if(buf[0] == '.' && buf[1] == '\n')
strcpy(buf, "..\n");