summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-08 17:22:41 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-08 17:22:41 +0800
commit12050a39fe9e5408ab2c114ac48066b5df3d8184 (patch)
tree5a638f84e50dce4faf5601d4bae1aab98a7dbe79
parent4e3e4e2d14e47bb50ca170b48eac683dd0950a48 (diff)
downloadpttbbs-12050a39fe9e5408ab2c114ac48066b5df3d8184.tar
pttbbs-12050a39fe9e5408ab2c114ac48066b5df3d8184.tar.gz
pttbbs-12050a39fe9e5408ab2c114ac48066b5df3d8184.tar.bz2
pttbbs-12050a39fe9e5408ab2c114ac48066b5df3d8184.tar.lz
pttbbs-12050a39fe9e5408ab2c114ac48066b5df3d8184.tar.xz
pttbbs-12050a39fe9e5408ab2c114ac48066b5df3d8184.tar.zst
pttbbs-12050a39fe9e5408ab2c114ac48066b5df3d8184.zip
add mail header
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@1227 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/mail.c15
-rw-r--r--pttbbs/util/outmail.c4
2 files changed, 12 insertions, 7 deletions
diff --git a/pttbbs/mbbsd/mail.c b/pttbbs/mbbsd/mail.c
index e0dced0f..396beb04 100644
--- a/pttbbs/mbbsd/mail.c
+++ b/pttbbs/mbbsd/mail.c
@@ -1460,11 +1460,16 @@ bbs_sendmail(char *fpath, char *title, char *receiver)
return -1;
if (fpath)
- fprintf(fout, "Reply-To: %s%s\nFrom: %s%s\n",
- cuser.userid, str_mail_address, cuser.userid,
- str_mail_address);
- fprintf(fout, "To: %s\nSubject: %s\n", receiver, title);
- fprintf(fout, "X-Disclaimer: " BBSNAME "對本信內容恕不負責。\n\n");
+ fprintf(fout, "Reply-To: %s%s\nFrom: %s <%s%s>\n",
+ cuser.userid, str_mail_address,
+ cuser.username,
+ cuser.userid, str_mail_address);
+ fprintf(fout,"To: %s\nSubject: %s\n"
+ "Mime-Version: 1.0\r\n"
+ "Content-Type: text/plain; charset=\"big5\"\r\n"
+ "Content-Transfer-Encoding: 8bit\r\n"
+ "X-Disclaimer: " BBSNAME "對本信內容恕不負責。\n\n",
+ receiver, title);
while (fgets(genbuf, 255, fin)) {
if (genbuf[0] == '.' && genbuf[1] == '\n')
diff --git a/pttbbs/util/outmail.c b/pttbbs/util/outmail.c
index f818d2c6..262c3a67 100644
--- a/pttbbs/util/outmail.c
+++ b/pttbbs/util/outmail.c
@@ -86,7 +86,7 @@ void doSendBody(int sock, FILE *fp, char *from, char *to, char *subject) {
char buf[2048];
n = snprintf(buf, sizeof(buf),
- "From: %s\r\n"
+ "From: %s <%s>\r\n"
"To: %s\r\n"
"Subject: %s\r\n"
"X-Sender: outmail of pttbbs\r\n"
@@ -94,7 +94,7 @@ void doSendBody(int sock, FILE *fp, char *from, char *to, char *subject) {
"Content-Type: text/plain; charset=\"big5\"\r\n"
"Content-Transfer-Encoding: 8bit\r\n"
"X-Disclaimer: [" BBSNAME "]對本信內容恕不負責\r\n\r\n",
- from, to, subject);
+ from, from, to, subject);
write(sock, buf, n);
while(fgets(buf, sizeof(buf), fp)) {