diff options
-rw-r--r-- | pttbbs/mbbsd/mail.c | 5 | ||||
-rw-r--r-- | pttbbs/mbbsd/record.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/pttbbs/mbbsd/mail.c b/pttbbs/mbbsd/mail.c index e86107a7..bc9eeccb 100644 --- a/pttbbs/mbbsd/mail.c +++ b/pttbbs/mbbsd/mail.c @@ -554,6 +554,11 @@ setforward(void) { if ((fp = fopen(buf, "r"))) { fscanf(fp, "%" toSTR(sizeof(ip)) "s", ip); fclose(fp); +#ifdef UNTRUSTED_FORWARD_TIMEBOME + if (dasht(buf) < UNTRUSTED_FORWARD_TIMEBOME) + unlink(buf); +#endif + } chomp(ip); prints("目前設定自動轉寄為: %s", diff --git a/pttbbs/mbbsd/record.c b/pttbbs/mbbsd/record.c index 4e73fe6f..8c36d052 100644 --- a/pttbbs/mbbsd/record.c +++ b/pttbbs/mbbsd/record.c @@ -525,6 +525,13 @@ append_record_forward(char *fpath, fileheader_t * record, int size, const char * fclose(fp); strip_blank(address, address); +#ifdef UNTRUSTED_FORWARD_TIMEBOME + if (dasht(buf) < UNTRUSTED_FORWARD_TIMEBOME) { + unlink(buf); + return 0; + } +#endif + if (get_num_records(fpath, sizeof(fileheader_t)) > MAX_KEEPMAIL_HARDLIMIT) { unlink(buf); // TODO add a mail so that origid knows what happened. |