📄 00000008.htm
字号:
if (*cmd==0) { <BR> outs("-ERR Too few arguments for the retr command."); <BR> return; <BR> } <BR> <BR> num = atoi(cmd); <BR> if (num <= 0 || totalnum < num) { <BR> sprintf(genbuf, "-ERR Message %d does not exist.", num); <BR> outs(genbuf); <BR> return; <BR> } else if (fcache[num-1].accessed[0] == 'X') { <BR> sprintf(genbuf, "-ERR Message %d has been deleted.", num); <BR> outs(genbuf); <BR> return; <BR> } <BR> num--; <BR> sprintf(genbuf, "+OK %d octets", postlen[num]); <BR> outs(genbuf); <BR> sprintf(genbuf, "From: %s", fcache[num].owner); <BR> outs(genbuf); <BR> sprintf(genbuf, "To: %s%s", currentuser.userid, BBSNAME); <BR> outs(genbuf); <BR> sprintf(genbuf, "Subject: %s", fcache[num].title); <BR> outs(genbuf); <BR> outs(""); <BR> sprintf(genbuf, "mail/%c/%s/%s", toupper(*LowUserid), LowUserid, fcache[num].filename); <BR> outfile(genbuf, 99999); <BR> <BR>} <BR> <BR> <BR>int <BR>Stat() <BR>{ <BR> if (State != S_LOGIN) { <BR> outs("-ERR Unknown command: \"stat\"."); <BR> return; <BR> } <BR> sprintf(genbuf, "+OK %d %d", totalnum, totalbyte); <BR> outs(genbuf); <BR>} <BR> <BR> <BR>int <BR>Rset() <BR>{ <BR> int i; <BR> <BR> if (State != S_LOGIN) { <BR> outs("-ERR Unknown command: \"rset\"."); <BR> return; <BR> } <BR> <BR> for (i = 0; i < totalnum; i++) { <BR> fcache[i].accessed[0] = ' '; <BR> } <BR> markdel = 0; <BR> sprintf(genbuf, "+OK Maildrop has %d messages (%d octets)", totalnum, totalbyte); <BR> outs(genbuf); <BR>} <BR> <BR>int <BR>List() <BR>{ <BR> int i; <BR> <BR> if (State != S_LOGIN) { <BR> outs("-ERR Unknown command: \"list\"."); <BR> return; <BR> } <BR> <BR> cmd = nextword(&msg); <BR> <BR> if (*cmd == 0) { <BR> sprintf(genbuf, "+OK %d messages (%d octets)", totalnum, totalbyte); <BR> outs(genbuf); <BR> for (i = 0; i < totalnum; i++) { <BR> if (fcache[i].accessed[0] == ' ') { <BR> sprintf(genbuf, "%d %d", i+1, postlen[i]); <BR> outs(genbuf); <BR> } <BR> } <BR> outs("."); <BR> } else { <BR> i = atoi(cmd); <BR> if (i <= 0 || totalnum < i) { <BR> sprintf(genbuf, "-ERR Message %d does not exist.", i); <BR> outs(genbuf); <BR> return; <BR> } else if (fcache[i-1].accessed[0] == 'X') { <BR> sprintf(genbuf, "-ERR Message %d has been deleted.", i); <BR> outs(genbuf); <BR> return; <BR> } <BR> sprintf(genbuf, "+OK %d %d", i, postlen[i-1]); <BR> outs(genbuf); <BR> } <BR> <BR>} <BR> <BR>int <BR>Top() /* Leeward adds, 98.01.21 */ <BR>{ <BR> int num; <BR> int ln; <BR> <BR> struct stat st; <BR> <BR> char *ptr; <BR> <BR> <BR> if (State != S_LOGIN) { <BR> outs("-ERR Unknown command: \"top\"."); <BR> return; <BR> } <BR> <BR> cmd = nextword(&msg); <BR> <BR> if (*cmd==0) { <BR> outs("-ERR Too few arguments for the top command."); <BR> return; <BR> } <BR> <BR> num = atoi(cmd); <BR> if (num <= 0 || totalnum < num) { <BR> sprintf(genbuf, "-ERR Message %d does not exist.", num); <BR> outs(genbuf); <BR> return; <BR> } else if (fcache[num-1].accessed[0] == 'X') { <BR> sprintf(genbuf, "-ERR Message %d has been deleted.", num); <BR> outs(genbuf); <BR> return; <BR> } <BR> <BR> cmd = nextword(&msg); <BR> <BR> if (*cmd==0) { <BR> outs("-ERR Too few arguments for the top command."); <BR> return; <BR> } <BR> <BR> ln = atoi(cmd); <BR> if (ln < 0) { <BR> sprintf(genbuf, "-ERR Line %d does not exist.", ln); <BR> outs(genbuf); <BR> return; <BR> } <BR> <BR> <BR> num--; <BR> sprintf(genbuf, "+OK %d octets", postlen[num]); <BR> outs(genbuf); <BR> sprintf(genbuf, "mail/%c/%s/%s", toupper(*LowUserid), LowUserid, fcache[num].filename); <BR> stat(genbuf, &st); <BR> ptr = ctime(&st.st_mtime); <BR>/* Wed Jan 21 17:42:14 1998 -- ctime returns <BR> 012345678901234567890123 -- offsets <BR> Date: Wed, 21 Jan 1998 17:54:33 +0800 -- RFC wants */ <BR> sprintf(genbuf, "Date: %3.3s, %2.2s %3.3s %4.4s %8.8s +0800", <BR> ptr + 0, ptr + 8, ptr + 4, ptr + 20, ptr + 11); <BR> outs(genbuf); <BR> sprintf(genbuf, "From: %s", fcache[num].owner); <BR> outs(genbuf); <BR> sprintf(genbuf, "To: %s%s", currentuser.userid, BBSNAME); <BR> outs(genbuf); <BR> sprintf(genbuf, "Subject: %s", fcache[num].title); <BR> outs(genbuf); <BR> outs(""); <BR> sprintf(genbuf, "mail/%c/%s/%s", toupper(*LowUserid), LowUserid, fcache[num].filename); <BR> outfile(genbuf,&
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -