diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-11-04 13:37:42 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-11-04 13:37:42 +0800 |
commit | 0b4f12f09ad2f8b7b3c4ef2e1ea78899f7089904 (patch) | |
tree | d29c4f478f05f9a2e17a37b5fdb9a25624adbda6 | |
parent | 14d85c44c19d2f2b515928395ddb44714dc50a61 (diff) | |
download | pttbbs-0b4f12f09ad2f8b7b3c4ef2e1ea78899f7089904.tar pttbbs-0b4f12f09ad2f8b7b3c4ef2e1ea78899f7089904.tar.gz pttbbs-0b4f12f09ad2f8b7b3c4ef2e1ea78899f7089904.tar.bz2 pttbbs-0b4f12f09ad2f8b7b3c4ef2e1ea78899f7089904.tar.lz pttbbs-0b4f12f09ad2f8b7b3c4ef2e1ea78899f7089904.tar.xz pttbbs-0b4f12f09ad2f8b7b3c4ef2e1ea78899f7089904.tar.zst pttbbs-0b4f12f09ad2f8b7b3c4ef2e1ea78899f7089904.zip |
use bbs.h, add Message-ID
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1292 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | util/outmail.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/util/outmail.c b/util/outmail.c index 262c3a67..10a7b6f9 100644 --- a/util/outmail.c +++ b/util/outmail.c @@ -1,20 +1,5 @@ /* $Id$ */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <fcntl.h> -#include <signal.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/types.h> -#include <sys/param.h> -#include <sys/file.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include "config.h" -#include "pttstruct.h" - +#include "bbs.h" #define SPOOL BBSHOME "/out" #define INDEX SPOOL "/.DIR" @@ -84,7 +69,11 @@ void disconnectMailServer(int sock) { void doSendBody(int sock, FILE *fp, char *from, char *to, char *subject) { int n; char buf[2048]; - + static int starttime = -1, msgid = 0; + if( starttime == -1 ){ + srandom(starttime = (int)time(NULL)); + msgid = random(); + } n = snprintf(buf, sizeof(buf), "From: %s <%s>\r\n" "To: %s\r\n" @@ -93,8 +82,11 @@ void doSendBody(int sock, FILE *fp, char *from, char *to, char *subject) { "Mime-Version: 1.0\r\n" "Content-Type: text/plain; charset=\"big5\"\r\n" "Content-Transfer-Encoding: 8bit\r\n" + "Message-Id: <%d.%x.outmail@ptt2.cc>\r\n" "X-Disclaimer: [" BBSNAME "]對本信內容恕不負責\r\n\r\n", - from, from, to, subject); + from, from, to, subject, starttime, + (msgid += (int)(random() >> 24))); + printf("%x\n", msgid); write(sock, buf, n); while(fgets(buf, sizeof(buf), fp)) { |