From 1468dc39fd67c39076b38bf4b9736394e416b6b3 Mon Sep 17 00:00:00 2001 From: piaip Date: Fri, 4 Apr 2008 04:14:57 +0000 Subject: - register: change notification mails to anonymous style - mail: fast reject on replying to system mail/anonymous mail. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4079 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/config.h | 4 ++++ include/pttstruct.h | 7 +++++++ mbbsd/bbs.c | 2 +- mbbsd/mail.c | 9 +++++++++ mbbsd/register.c | 15 +++++++++++++-- sample/etc/registered | 4 +--- sample/etc/registeredmail | 2 -- 7 files changed, 35 insertions(+), 8 deletions(-) diff --git a/include/config.h b/include/config.h index 694a2e4f..a8f5a0b2 100644 --- a/include/config.h +++ b/include/config.h @@ -45,6 +45,10 @@ #define BN_SYSOP "SYSOP" #endif +#ifndef BN_ID_PROBLEM +#define BN_ID_PROBLEM "SYSOP" +#endif + #ifndef BN_LAW #define BN_LAW BBSMNAME "Law" #endif diff --git a/include/pttstruct.h b/include/pttstruct.h index 89b4c6b7..263cad44 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -454,9 +454,16 @@ typedef struct keeploc_t { /* MAX_BMs is dirty hardcode 4 in mbbsd/cache.c:is_BM_cache() */ #define MAX_BMs 4 /* for BMcache, ¤@­Ó¬ÝªO³Ì¦h´XªO¥D */ +// TODO +// ­þ¤Ñ½Ð¦n¤ß¤H¾ã²z shm: +// (1) ¼W¥[ shmsize +// (2) userinfo_t ¥i¥H²¾±¼¤@¨Ç¤w¤£¥Îªº + #define SHM_VERSION 3276 typedef struct { int version; + // int shmsize; // TODO add this: sizeof(SHM_t), for verification + /* uhash */ /* uhash is a userid->uid hash table -- jochang */ char userid[MAX_USERS][IDLEN + 1]; diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index c964cd73..86443d6c 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -3103,7 +3103,7 @@ del_range(int ent, const fileheader_t *fhdr, const char *direct) stand_title("§R°£¥¢±Ñ"); outs("\n\nµLªk§R°£ÀɮסC¥i¯à¬O¦P®É¦³¨ä¥¦¤H¤]¦b¶i¦æ§R°£¡C\n\n" "­Y¦¹¿ù»~«ùÄòµo¥Í¡A½Ðµ¥¬ù¤@¤p®É«á¦A­«¸Õ¡C\n\n" - "­Y¨ì®É¤´µLªk§R°£¡A½Ð¨ì SYSOP ¬ÝªO³ø§i¡C\n"); + "­Y¨ì®É¤´µLªk§R°£¡A½Ð¨ì " BN_SYSOP " ¬ÝªO³ø§i¡C\n"); vmsg("µLªk§R°£¡C¥i¯à¦³¨ä¥¦¤H¥¿¦b¦P®É§R°£¡C"); return FULLUPDATE; } else diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 17dea28e..f9e116ca 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -116,6 +116,7 @@ mail_muser(userec_t muser, const char *title, const char *filename) return mail_id(muser.userid, title, filename, cuser.userid); } +// TODO add header option? int mail_log2id(const char *id, const char *title, const char *src, const char *owner, char newmail, char trymove) { @@ -1270,6 +1271,14 @@ mail_reply(int ent, fileheader_t * fhdr, const char *direct) if (!fhdr || !fhdr->filename[0]) return DONOTHING; + if (fhdr->owner[0] == '[' || (fhdr->filemode & FILE_ANONYMOUS)) + { + // system mail. reject. + vmsg("µLªk¦^«H¡C"); + return FULLUPDATE; + } + + stand_title("¦^ «H"); /* §PÂ_¬O boards ©Î mail */ diff --git a/mbbsd/register.c b/mbbsd/register.c index 09e25451..22d7e867 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -1474,13 +1474,17 @@ regform_accept(const char *userid, const char *justify) kick_all(muser.userid); } + // According to suggestions by PTT BBS account sysops, + // it is better to use anonymous here. #if FOREIGN_REG_DAY > 0 if(muser.uflag2 & FOREIGN) - mail_muser(muser, "[¥X¤J¹ÒºÞ²z§½]", "etc/foreign_welcome"); + mail_log2id(muser.userid, "[System] Registration Complete ", "etc/foreign_welcome", + "[SYSTEM]", 1, 0); else #endif // last: send notification mail - mail_muser(muser, "[µù¥U¦¨¥\\Åo]", "etc/registered"); + mail_log2id(muser.userid, "[¨t²Î³qª¾] µù¥U¦¨¥\\ ", "etc/registered", + "[¨t²Î³qª¾]", 1, 0); } void @@ -1520,11 +1524,18 @@ regform_reject(const char *userid, const char *reason, const RegformEntry *pre) if(pre) print_regform_entry_localized(pre, fp, 1); fprintf(fp, "%s µù¥U¥¢±Ñ¡C\n", Cdate(&now)); + // prompt user for how to contact if they have problem + fprintf(fp, ANSI_COLOR(1;31) "¦p¦³¥ô¦ó°ÝÃD©Î»Ý­n»P¯¸°È¤H­ûÁpµ¸½Ð¦Ü" + BN_ID_PROBLEM "¬ÝªO¡C" ANSI_RESET "\n"); // multiple abbrev loop regform_print_reasons(reason, fp); + fclose(fp); + // According to suggestions by PTT BBS account sysops, + // it is better to use anonymous here. + // // XXX how to handle the notification file better? // mail_log2id: do not use move. // mail_muser(muser, "[µù¥U¥¢±Ñ]", buf); diff --git a/sample/etc/registered b/sample/etc/registered index 1b52a301..0005957c 100644 --- a/sample/etc/registered +++ b/sample/etc/registered @@ -2,9 +2,7 @@  ùàùùùûùàùùùûùüùùùû ¼f®Ö³q¹L  ¡º¢w¢w ùãùùùýùãùùùýùüùùùý¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¡º - ¶Ù¶Ù¡A*s§A¦n¡G - - §Ú¿Ë¦ÛÀ°§A¼f®Ö³q¹LÅo ^o^ + ±z¤w³q¹Lµù¥U¼f®Ö¡C ­YÁÙ¤£¯àPost½Ð­«·slogin¤@¦¸ ^_^ (­n´«¨­¥÷Åo) diff --git a/sample/etc/registeredmail b/sample/etc/registeredmail index 255f2708..01242b1b 100644 --- a/sample/etc/registeredmail +++ b/sample/etc/registeredmail @@ -2,8 +2,6 @@  ùàùùùûùàùùùûùüùùùû EMail»{ÃÒ³q¹L  ¡º¢w¢w ùãùùùýùãùùùýùüùùùý¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¡º - ¶Ù¶Ù¡A*s§A¦n¡G - Åwªï¥[¤J ptt2 ªº¦æ¦C ^o^ ­YÁÙ¤£¯àPost½Ð­«·slogin¤@¦¸ ^_^ (­n´«¨­¥÷Åo) -- cgit v1.2.3