看板Maple
标 题[转录]Re: Maple 3 系列应修改 mail.c...
发信站小鹿鹿 BBS (Sun May 25 20:49:21 2003)
转信站Ptt!news.cs.nthu!abpe.org
※ 本文转录自 [Daily] 看板
作者: DarkKiller (悸动) 看板: Daily
标题: Re: Maple 3 系列应修改 mail.c...
时间: Sun May 25 20:48:49 2003
※ 引述《DarkKiller (悸动)》之铭言:
> 在 Maple 3 系列的 mail.c 里面应该会有一段关於 bbsreg 的 code:
> fprintf(fw, "From: %s\r\nTo: %s\r\nSubject: %s\r\nX-Sender: %s (%s)\r\n"
> 这段 code 应修改为:
> fprintf(fw, "From: BBS Register <%s>\r\nTo: %s\r\nSubject: %s\r\nX-Sender: %s (%s)\r\n"
> 这样可以避免 SpamAssassin 这套有名的 AntiSpam Software 的这条 Rule:
> NO_REAL_NAME (1.1 points) From: does not include a real name
抱歉,上面的改法会让一般信件寄出来的时候也有 BBS Register,请参考下面
的改法:
--- mail.c.orig Sun May 25 20:39:54 2003
+++ mail.c Sun May 25 20:45:34 2003
@@ -276,7 +276,7 @@
int sock;
time_t chrono, stamp;
FILE *fp, *fr, *fw;
- char *str, buf[512], from[80], subject[80], msgid[80];
+ char *str, buf[512], from[80], subject[80], msgid[80], nick[80];
#ifdef HAVE_SIGNED_MAIL
char prikey[9];
union{
@@ -302,6 +302,7 @@
title = subject;
/* Thor.990125: MYHOSTNAME统一放入 str_host */
sprintf(from, "bbsreg@%s", str_host);
+ strcpy(nick, "BBS Register");
archiv32(str_hash(rcpt, chrono), buf);
/* sprintf(title, "[MapleBBS]To %s(%s) [VALID]", cuser.userid, buf); */
/* Thor.981012: 集中在 config.h 管理 */
@@ -311,6 +312,7 @@
{
/* Thor.990125: MYHOSTNAME统一放入 str_host */
sprintf(from, "%s.bbs@%s", cuser.userid, str_host);
+ strncpy(nick, cuser.username, sizeof(nick));
}
str = strchr(rcpt, '@') + 1;
@@ -377,10 +379,10 @@
/* ------------------------------------------------- */
/* Thor.990125: 尽可能的像 RFC822 & sendmail的作法, 免得别人不接:p */
- fprintf(fw, "From: %s\r\nTo: %s\r\nSubject: %s\r\nX-Sender: %s (%s)\r\n"
+ fprintf(fw, "From: \"%s\" <%s>\r\nTo: %s\r\nSubject: %s\r\nX-Sender: %s (%s)\r\n"
"Date: %s\r\nMessage-Id: <%s@%s>\r\n"
"X-Disclaimer: [%s] 对本信内容恕不负责\r\n\r\n",
- from, rcpt, title, cuser.userid, cuser.username,
+ nick, from, rcpt, title, cuser.userid, cuser.username,
Atime(&stamp), msgid, str_host,
str_site);
--
Resistance is futile.
<
[email protected]>
--
※ Origin: 邪恶小鹿鹿 <Deer.twbbs.org> ◆ From: news.math.nctu.edu.tw