diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-05-24 17:37:47 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-05-24 17:37:47 +0800 |
commit | f03d0717f20d47251703d880fd6b487abefcef67 (patch) | |
tree | afd734943308ab168137d5d1f1a3965822aa3f8f /util/bbsmail.c | |
parent | ae18d6ceb1b44fdd6178844eb04ac8816038ea50 (diff) | |
download | pttbbs-f03d0717f20d47251703d880fd6b487abefcef67.tar pttbbs-f03d0717f20d47251703d880fd6b487abefcef67.tar.gz pttbbs-f03d0717f20d47251703d880fd6b487abefcef67.tar.bz2 pttbbs-f03d0717f20d47251703d880fd6b487abefcef67.tar.lz pttbbs-f03d0717f20d47251703d880fd6b487abefcef67.tar.xz pttbbs-f03d0717f20d47251703d880fd6b487abefcef67.tar.zst pttbbs-f03d0717f20d47251703d880fd6b487abefcef67.zip |
discard 1998
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2019 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/bbsmail.c')
-rw-r--r-- | util/bbsmail.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/util/bbsmail.c b/util/bbsmail.c index 24065ef1..dd015099 100644 --- a/util/bbsmail.c +++ b/util/bbsmail.c @@ -78,7 +78,7 @@ void str_decode_M3(unsigned char *str); int mail2bbs(char *userid) { - int uid, fd; + int uid; fileheader_t mymail; char genbuf[512], title[512], sender[512], filename[512], *ip, *ptr; time_t tmp_time; @@ -156,6 +156,9 @@ int mail2bbs(char *userid) if( strchr(sender, '@') == NULL ) /* ¥Ñ local host ±H«H */ strcat(sender, "@" MYHOSTNAME); +/* allocate a file for the new mail */ + stampfile(filename, &mymail); + #ifdef HMM_USE_ANTI_SPAM for (n = 0; notitle[n]; n++) if (strstr(title, notitle[n])) @@ -175,9 +178,11 @@ int mail2bbs(char *userid) } #endif - if( (fd = stampfilefd(filename, &mymail)) == -1 || - (fout = fdopen(fd, "wt")) == NULL ) + if ((fout = fopen(filename, "w")) == NULL) + { + printf("Cannot open %s\n", filename); return -1; + } if (!title[0]) sprintf(title, "¨Ó¦Û %.64s", sender); |