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
commit2978142804c88a847e4f610b2db84206335eb136 (patch)
treeacf1ff352dd10817b71723da3f6d7ed16188d6dc
parent6f06972bcd8ff5a4933ddf40f2913c9b8e8e59cc (diff)
downloadpttbbs-2978142804c88a847e4f610b2db84206335eb136.tar
pttbbs-2978142804c88a847e4f610b2db84206335eb136.tar.gz
pttbbs-2978142804c88a847e4f610b2db84206335eb136.tar.bz2
pttbbs-2978142804c88a847e4f610b2db84206335eb136.tar.lz
pttbbs-2978142804c88a847e4f610b2db84206335eb136.tar.xz
pttbbs-2978142804c88a847e4f610b2db84206335eb136.tar.zst
pttbbs-2978142804c88a847e4f610b2db84206335eb136.zip
add mail header: Mime-Version, Content-Type, Content-Transfer-Encoding
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@803 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/util/outmail.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/pttbbs/util/outmail.c b/pttbbs/util/outmail.c
index 804638e5..d8efb526 100644
--- a/pttbbs/util/outmail.c
+++ b/pttbbs/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");