diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-28 13:50:52 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-28 13:50:52 +0800 |
commit | 76c3cd196a66c1e8a1df39d6cca858cb722986ee (patch) | |
tree | 9d07af8b3a35fca78565e532b819bb1aeefe5a4f /mbbsd | |
parent | 54bb9f7ff65c209b79c409df45c4e03fb8b8c4ac (diff) | |
download | pttbbs-76c3cd196a66c1e8a1df39d6cca858cb722986ee.tar pttbbs-76c3cd196a66c1e8a1df39d6cca858cb722986ee.tar.gz pttbbs-76c3cd196a66c1e8a1df39d6cca858cb722986ee.tar.bz2 pttbbs-76c3cd196a66c1e8a1df39d6cca858cb722986ee.tar.lz pttbbs-76c3cd196a66c1e8a1df39d6cca858cb722986ee.tar.xz pttbbs-76c3cd196a66c1e8a1df39d6cca858cb722986ee.tar.zst pttbbs-76c3cd196a66c1e8a1df39d6cca858cb722986ee.zip |
- allow F forward only for authenticated users
- check reject list for local users in F forward
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4252 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/mail.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 4030c6db..cc19fee3 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -2029,12 +2029,42 @@ doforward(const char *direct, const fileheader_t * fh, int mode) if (invalidaddr(address)) return -2; - outmsg("正轉寄請稍候..."); + outmsg("轉寄中請稍候..."); refresh(); /* 追蹤使用者 */ if (HasUserPerm(PERM_LOGUSER)) log_user("mailforward to %s ",address); + + // 處理站內黑名單 + do { + char xid[IDLEN+1], *dot; + char fpath[PATHLEN]; + int i = 0; + + strlcpy(xid, address, sizeof(xid)); + dot = strchr(xid, '.'); + if (dot) *dot = 0; + dot = strcasestr(address, ".bbs@"); + + if (dot) { + if (strcasecmp(strchr(dot, '@')+1, MYHOSTNAME) != 0) + break; + } else { + // accept only local name + if (strchr(address, '@')) + break; + } + + // now the xid holds local name + sethomefile(fpath, xid, FN_OVERRIDES); + i = belong(fpath, cuser.userid); + sethomefile(fpath, xid, FN_REJECT); + // TODO 該 return 哪種值? + if (!i && belong(fpath, cuser.userid)) + return -1; + } while (0); + if (mode == 'Z') { snprintf(fname, sizeof(fname), TAR_PATH " cfz /tmp/home.%s.tgz home/%c/%s; " |