BBS水木清华站∶精华区

发信人: AimHigh (嘟嘟&让我们荡起双桨~~~), 信区: Unix 
标  题: 本斑所有的关于Mail的文章集锦(除pop3) 
发信站: BBS 水木清华站 (Fri Oct 30 15:26:47 1998) 
 
BY-tsai.bbs@eesun.cycu.edu.tw,foobar,albin,ruyun 
Q-能收信,但却不能mail出去? 
R-: >   请问要改sendmail 中的什麽地方? 
My System 是sunos 4.1.4.4 sparc20 
∶ 在 sendmail.cf 里加上这一行 
∶ Fw-o /etc/sendmail.cw 
∶ 在 sendmail.cw  加上你的 domain name ,以下是范例 
∶ /etc/sendmail.cw 
∶ localhost 
∶ host.dom.ain 
∶ dom.ain 
举例:假设你的 host name 是 eesun,domain name 是 cycu.edu.tw 
所以host.dom.ain == eesun.cycu.edu.tw 
dom.ain == cycu.edu.tw 
因此 /etc/sendmail.cw 是这样写的 
localhost 
eesun.cycu.edu.tw 
cycu.edu.tw 
意思是说当 sendmail 收到 user@eesun.cycu.edu.tw, user@cycu.edu.tw 
的信件时都会当作 localmail 来处理。 
你可以自己作个实验,发一封 e-mail 给 root@localhost(假设你就是 root) 
当收到信时你会发现收信人不是 root@localhost,而是 root@eesun.cycu.edu.tw 
这样你应该可以了解了吧! 
∶ 甚至本机用户之间发E-mail也收不到?这是为啥? 
∶E-mail Server是Sun Server 1000,安装的操作系统是Solaris 2.5 
首先检查sendmail精灵进程是否在运行,输入: 
        ps -efl|grep sendmail 
你应当看见和下面类似的信息 
    root   175     1  0 15:46:45 ?        0:00 /usr/lib/sendmail -bd -q15m 
如果你没有看见sendmail精灵进程在运行,那么用下面的命令启动它. 
(你必须有root权限) 
        /usr/lib/sendmail -bd -q15m 
Also you can telnet from other host to your mail server through port 25 
 to debug the sendmail daemon. 
 Why you can't recieve email from outside? You machine name is in the DNS 
 table, such that the other machine knows it? Just try to telnet to the mail 
 server, if responds as "unknow host", then you IP is not in the DNS or local 
 file. Then try to send mail in the format as "foobar@123.3.4.7" , where 
 123.3.4.7 is the IP address of the mail server. 
It is bettter that you send maio from another host to your machine, and 
themail daemon's error message will tell you what is the problem with 
your mail system. 
∶我实用的是SGI工作站,操作系统是IRIX6。2。大约从两天以前,机器重新启动 
以后,我的机器只能够发e-mail,但不能够收e-mail。系统给我的提示是:system 
configure error, mail loop return to myself。 另外,我登录到另一台计算机,并 
用 Mail -v 的命令向本机发mail以便于监视整个命令的这些过程,结果发现:本机正 
常地接收到e-mail,系统没有给出任何出错信息。因此我猜测,root很可能正常地收到 
e-mail,但由于某些设置不对,使得root无法把e-mail转发给其他用户。不知道我的 
猜测对否,请各位高手指教。 
Have you DNS server? Is it running? 
修改记录主机名字的宏变量 w 或相应的 
类定义文件  sendmail.cw. 
∶ 我用的是Solaris 2.5.1,但sendmail.cf的设置始终不对,只能发不能 
∶ 收email,请教各位大虾,能否赐教该文件的详细配置,特别是subsidiary的, 
∶ 本人不胜感激。 
先决定你的机器是独立mail服务器AI还是通过其他mail服务器转发 
前者要cp main.cf sendmail.cf再修改sendmail.cf设置 
后者直接修改sendmail.cf设置 
 
BY- 
Q-只能收信,发不出去 
R-新近配置一台Ultra1 
sendmail.cf配置仅更改了major relay host为 
本机(mail)如DRmail 
CRmail 
#       General configuration information 
Dm mail.mydomain 
Cm mail.mydomain 
其余为 
# my official hostname 
Dj$w.$m 
# major relay mailer 
DMether 
可就是发不出信,说host unknow 
或too many hops 
    看来你用的是SUN的sendmail, 对此我不是很熟悉,建议你改为 
Berkeley Sendmail 8.9.1, Berkeley Sendmail自带sendmail.cf 
生成器(当然你要看一点文档), 配置还是比较简单的。 
 
BY-wolfsmile 
Q-怎样使mail server所发信件格式为user@domain? 
R-我的host是整个子网的mail server(Sun Solaris) 
但不知如何配置(及哪个文件)可使它发出的信 
格式为user@domain 
而不是user@host.domain 
In sendmail.cf ,you can set the mail domain name,you can set it your domain 
   name,that is ok, 
if your domain is a.b.c it ius a line like that(maybe,u can check it): 
Dma.b.c 
 
BY-omega 
Q- 
R-: Who can explain the meaning of the lines(in sendmail.cf)  below: 
∶ ############################################################################ 
∶ # my official hostname 
∶ # You have two choices here.  If you want the gateway machine to identify 
∶ # itself as the DOMAIN, use this line: 
∶ #Dj$m 
∶ # If you want the gateway machine to appear to be INSIDE the domain, use: 
∶ Dj$w.$m 
∶ # if you are using sendmail.mx (or have a fully-qualified hostname), use: 
∶ #Dj$w 
∶ ############################################################################ 
∶ Thx. 
$j -- fully qualified name of the host 
$w -- name of the host 
$m -- I am not sure, it must the domain name of the network. 
 
BY-andersen 
Q-如想配置SOLARIS为网络的Mail Server,需要什么软件?哪里可以D到? 
R-Netscape Messaging Server V3.05 
it is free in ftp.gznet.edu.cn/mirror/netscape 
 
BY-pure 
Q-请问Netscape Messaging Server和Netscape Mail Server有啥区别? 
R-in the netscape suitespot,just called messaging server v3.5 
 
BY-mkwf 
Q- 
R-我的邮件服务器在每次重启动机器后,都要先杀in.named这个进程,然后再启动此进程, 
才能收到邮件。是否是这个进程执行的先后顺序有关。盼高手指教。 
 in.named is the Domain Name Services deamon. 
 
BY- 
Q- 
R-我的本地(SUN工作站)信箱今天总自动产生一些内容,不知是什么原因,求教各位了. 
This text is part of the internal format of your mail folder, and is not 
a real message.  It is created automatically by the mail system software. 
If deleted, important folder data will be lost, and it will be re-created 
with the data reset to initial values. 
 
 
BY-omega,redflad 
Q-哪位有PINE配置文件的???就是.pinerc 文件 
R-You can get one by 
pine -f 
把原来的删了,再运行 pine也行. 
 
BY-yyy.bbs@csie.nctu.edu.tw 
Q-谁装过pop3d? 
R-: :       我装了一套pop3d在系统上(SunOS 4.1.3 Sparc 20 WS) 
∶ :       改了 /etc/services, 也改了 /etc/inetd.conf 
∶ :       kill -HUP (pid-inetd)後, 用 telnet host 110(pop3 的 port) 
∶ :       确连不上去, 何故 ? 
∶ 不会吧...我也在 4.1.3 上装了一个... 
∶ 只要你有照 readme 做.应该都可以... 
∶ 你那台是 standalone  还是 server 啊.. 
∶          ^^^^^^^^^^^ 
∶     standalone  如何 run ? 此外 kill -HUP 後还须做何事吗? 
如果是 standalone .在 Makefile 里有个地方要 uncomment 掉... 
如果是 yp server .则还要做 yp 的 make 
∶ 需要安装POPServer, 目前在UNIX上比较常用的是Qualcomm的QPOPPER, 可以到他的 
∶ FTP站点爪一个装上, 是FREE的, 7月3日的版本是2.52. 
到Dick的FTP来抓吧qpopper2.53 
ftp/166.111.64.10/unix/pop3/ 
 
BY- 
Q-怎么看sendmail的版本号 
R-telnet hostname 25 
BY-BlueOcean 
Q-怎样去掉mail 大小的限制? 
R-请你详细地将你的系统名称,版本,及设置等等 
描述出来。 
不知你在MAIL目录里是否设置了quota,如果设置 
了,改一下quota就应该可以了。 
 
BY-codex.bbs@sun1.nhctc.edu.tw 
Q-请问 出现 sendto: Host is unreachable... 
R-:       但是 我用其他的机器 可以连上这部Host.... 
啊有可能那个netmask | broadcast没设好. 
ifconfig -a看看; 
另外请用netstat -nr, traceroute trace你的routing 
有没有问题. 
如果有问题, 可能动到的档案: 
/etc/netmasks 
要用到的程式: 
/etc/ifconfig, route 
 
BY-tuic,goodluck 
Q- 
R-: 我使用的是Solaris 2.5.1,不知为什么在UNIX命令行下用mail 
∶ 发信,对方接收到后,From域如下: 
∶ <From:foxy@perrr? 
∶ 域名不知道跑到哪儿去了! 
∶ 请问是否要配置sendmail.cf ,如何配置? 
∶ 谢谢! 
配Cm Dm 变量 
  我配置了,但还是不对 
还有用 SUBSIDIARY MACHINES还是MAIN 
我在其中加了 
Dmxjtu.edu.cn 
并把/etc/mail/sendmail.cf copy to /etc/sendmail.cf 
还是不对呀?! 
用Main. 
 
BY-jerry 
Q-IRIX里必EMAIL找不到主机名 
R-: 每回用mail 命令发Email时,总是说: 
∶ “My host name (SGI-S) does not seem to exist!” 
∶ 即使是给本地帐户发mail也是这样。 
∶ 我想是EMAIL的设置不正确,但是我对IRIX很不熟悉,找不着该用什么命令来修改配置, 
∶ 请高手不吝赐教,多谢。 
configmail list 
configmail setup 
configmail set ... 
 
BY-dong 
Q-Solaris下的mail设置 
R-: 某Solaris的DNS均工作正常。 
∶ 在/etc/mail/sendmail.cf中将major relay host 设为 
∶ 此机连入的网关名。 
∶ 信能发出,但三天后收到回信说mail dilevry subsy 
∶ connection refused by 网关。 
∶ 难道把relay host 设成本机吗? 
∶ 请教各位大虾。。。 
应设成某个mail服务器. 
如DR mail.tsinghua.edu.cn 
 
BY-zyliang,feige,swimmer,weij,ytan 
Q-how to use unix 发附件 
R-uuencode the attach file, then use the mailx, and the ~r command 
pine, 
cat <file> | uuencode <NameAttach> | mailx -s <subject> <TargetDest> 
mail emailaddress < filename 
eg:假如附件为"file1" 
#mail 黄飞鸿@十三姨.edu.cn <file1 
file1得是经过uuencode编码后的文件, 
也可以mailx 黄飞鸿@十三姨.edu.cn 
写好Subject还有你想说的话以后, 另外起一行, 写 
~r file1 
最后再用'.'号结束 
 
BY-gibbon 
Q-为什么在NETSCAPE下的MAILBOX不能取出UNIX的PINE下的邮件? 
R-当然不能。 
PINE已经从系统邮箱中把你的邮件搞走了。 
看你把PINE的邮箱设到哪去了。 
 
BY-omega,scaner 
Q-为什么sendmail不处理mqueue中的信件 
R-我用的Email Server出了个问题 
现在我用mailq可以看到email queue中我的信 
可总是收不到 
请问用什么方法才可以收到我的信? 
∶ mqueue 里堆积了很多信,可sendmail就是不往用户信箱里分发. 
∶ 有谁知道可能是什么原因? 
Sendmail is working, but your local mailer is not. 
把信分发到个人的信箱的工作不是由sendmail来作的么? 
local mailer指的是什么?mail,mailx,elm么? 
我用sendmail -q -v看接果,却发现都是类似这样的结果,一封也没发,why? 
Skipping AA04064 
Skipping AA04021 
Skipping AA04111 
.... 
到sendmail的配置文件中找Mlocal就能看到了 
日志文件中应该有更详细的信息,可以参考一下 
看不出什么名堂来.只有一些诸如: 
class=0;delay=00:00:54;stat=queued之类的东西,你知道是什么意思么? 
另外我用mailq看发现,所有的信件的QID后都有一个X,这又是什么含意? 
 
BY-andersen 
Q-如何统计mail list数量 
R-我想在linux下编一个程序,是统记mail list各分类的数量的,原想找个mail过滤程序找个 
切入点,利用原有软件工能,但不知从何下手,请高人指点! 
搞一份sendmail的最新版本(如sendmail8.9.1)都是原码 
也有说明,改改就行了 
 
BY-gqshen 
Q-PINE来接收中文邮件乱码? 
R-是怎样的乱码? 这有很多可能. 可能是码不对(GB和B5), 
也可能是被strip成7bit了, 你应该让你的pine通过8bit, 
当然对方也要是8bit的. 还有一种可能是HZ码, 你应该有 
相应的viewer. 
 
BY-yuhj,htli,larkwang 
Q- 
R-你确认他的机器你能PING通么?或者nslookup能找到他机器的IP么? 
还有,你试试telnet his_ip 25 看看有没有反应。 
∶ 给朋友的一台服务器发MAIL,连试几次都被打回。出错信息 
∶ 是“host lookup failure".那边也找不出原因,新装的服务 
∶ 器几个星期没受到MAIL了。他的SERVER是Solaris2.4,sendmail 
∶ 已删除,用的是LOTUS NOTES 的MAIL。拜托大虾指点,可能 
∶ 是何处出了问题? 
既然是host lookup failure,就应该是域名的问题。恐怕还没有找到IP 
自然也不会去连25号端口了。 
解决办法只有一个,找DNS服务器的管理员。 
∶大虾们的办法我都试过了。能PING通域名,能TELNET该� Jun 13 05:12 sendmail.cf 
-rw-r--r--   1 root     system     33336 Jun 13 00:51 sendmail.cf.old 
-rw-r--r--   1 root     system        25 Jun 14 02:00 sendmail.pid 
  也看不到sendmail.cfDB文件. 
# refresh -s sendmail 
0513-036 The request could not be passed to the sendmail subsystem. 
Start the subsystem and try your command again. 
# sendmail -bz 
Frozen configuration files are unsupported 
Frozen configuration files are unsupported 
    Frozen configuration files?怎么让它不是frozen? 
# /usr/lib/sendmail -bd -q30m 
# ps -ef|grep sendmail 
    root 16644     1   0 02:22:48      -  0:00 sendmail: accepting connections 
    root 17930 16016   0 02:22:54  pts/1  0:00 grep sendmail 
   出现了什么sendmail:accepting connections 
   现在在本机上可以用mailx 收发邮件,在Eudora中可以用POP3收信件.但如果把SMTP 
   server指定为该机,就不能发信件. 
而另一台(AIX 4.1.4)上则是很正常. 
# ps -ef|grep sendmail 
    root  2916  5188   0   Jun 13      -  0:00 /usr/lib/sendmail -bd -q30m 
    root 20600 21104   1 18:35:17  pts/1  0:00 grep sendmail 
# refresh -s sendmail 
0513-095 The request for subsystem refresh was completed successfully. 
# sendmail -bz 
# 
 
BY-I007 
Q-如果MAIL SERVER不是24小时都开机,应如何设置? 
R-: : 由于所里的规定,我们实验室的所有计算机晚上必须关机,好在所里的网络室提供 
∶ : 服务,他们的机器是24小时都开的,而且在所里的名字服务器里已经加近了关于 
∶ : 我们的MAIL SERVER的MX记录,请问在我们实验室的MAIL SERVER 应该如何设置, 
∶ : 是设RELAY 还是 SMARTHOST? 
∶ : BTW:哪位大侠能解释一下RELAY 和 SMARTHOST, 我一直弄不大懂 
sendmail是很复杂的一个东东, 就我所知的解答吧 
1.DNS要改, MX记录有一个表示优先级的一个数(hehe.一时记不起叫什么了), 
  对于你的的mail server, 就必须有两条MX记录, 指向你的mail server的 
  优先一些(设为10),指向所里服务器的设为20, 这样对方的邮件在不能发到 
  你的mail server上时,就会试着发到所里的服务器上 
2.你的mail server最好为relay设到所里的服务器 
  sendmail.cf 中 
  DRrelayhost 
  CRrelayhost 
3.所里的邮件服务器也要有所配置, 有很多mailserver都是可以转发邮件的, 
  如果是那样的话,就不用改了 
 
BY- 
Q- 
R-我的网络有两个网段,分别有一套域名服务器和邮件服务器,两套系统分别都能正常运行, 
(分别能收发国内外E-mail)。但是!!!!-------从其中一台机器发E-mail到另一台正常 
(能收到,慢)但从另一台发到这一台收不到!Why!!!??? 
机型:1。SUN Sparc2 
        2.Sun Ultra30 
系统:1.SunOS4.1.3 
        2.Soraris2.6 
注:我检查不出DNS配置有任何错误 
 
BY-luojm 
Q-如何给机器上所有用户发广播邮件?(AIX系统) 
R-: 有一消息需告知所有用户, 
∶ 有无简单的方法同时向所有用户发一邮件? 
∶ (AIX系统) 
Add a group that including all users of your system , 
and then make an alias of this group. 
This is a way. 
∶ 有什么办法能给一个组定义alias? 
∶ 是AIX的新功能还是sendmail有什么修改? 
∶ 或者其他? 
你可以先vi一个such as :groupall.list文件,里面包含所有用户。 
(每个用户名占一行) 
再vi /etc/aliases文件,加上一行such as : 
all: :include:/..(路径)/groupall.list 
That's OK! 
Then ,you can use" mail all"to send a message to all users. 
那倒不如写个awk程序,处理一下passwd算了. 
 
BY-pegesus.bbs@bbs.ee.nthu.edu.tw,gqshen 
Q-如何在e-mail上加上签名档 
R-:     在信上加签名档的方法如下: 
∶     请在您的home directory造一个`.signature`的新档,编辑自己所 
∶     喜爱的signature,然後在edit .elm/elmrc这个file如下: 
∶     # remote ".signature" file to append to appropriate messages... 
∶     remotesignature = ~/.signature 
∶     localsignature = ~/.signature 
∶     sigdashes = ON 
∶ 我在自己的根目录下建立了.signature文件,但并不能把他加到mail中,还需要在什么文件 
∶ 中进行设置呢?在哪里? 
要根据不同的mail client来设, 一般elm和pine的默认就是~/.signature. 
其他如果没默认就要设一下了. 
他们都有自己的setup界面.不过你都可以自己手动改rc文件. 
 
BY-vertex 
Q- 
R-: sendmail在发送邮件时,是直接向email地址里的那个server发送,还是 
∶ 象路由器发送IP包那样要经过几个hop? 
∶ 如果不是直接发送,那么又是怎么决定向哪里发送呢? 
sendmail同DNS查循的原理很相似 
那么为什么不直接发送呢? 
dns server都知道root server的位置, 难道sendmail也有个root server? 能否具体解释 
一下. 
 
BY-gqshen 
Q- 
R-Is there any program can get the mail (POP3) 
under unix's text terminal? 
Can pine3.96 do that thing? or there are something better? 
qpop3,pine就可以. 而且是在console下. 
 
BY-Mccartney 
Q-怎样定期清除邮件? 
R-: 我使用的是Solaris 2.5 for SPARC,有很多用不来取邮件,我想定期清除它们,比如三 
∶ 个月不来取的邮件就删除。请介绍详细一点。谢谢。 
我没记得有什么现成的东西,编个程序吧,判断一下/var/mail下文件的日期,早的 
删掉就可以了。 
 
 
BY-wshu 
T- .mailrc文件的格式 
.mailrc 档是你在用 mail 指令时会参考到的 initial file 
 
以下是版主 wshu 所用的 .mailrc 档、供大家作为参考 
########################################################## 
 
set alwaysignore 
set askcc        ===>> 每次寄信时都会问你要不要 Carbon copy 给其他人 
set noaskbcc     ===>> 不问 blind Carbon copy 
set asksub 
set autoprint 
set bell=2 
set flash=2 
set cmd="lpr -p &" 
set crt=15 
set DEAD=~/Mail/dead.letter   ===>> 将 dead letter 放到 ~/Mail 下 
set EDITOR=ex 
set hold 
set indentprefix="> " 
set keepsave 
set metoo 
set onehop 
set PAGER="cat -s | more -22 -c" 
set prompt="{Mail}& "          ===>> 看 mail 时的提示符号 
set record=~/Mail/.record      ===>> 寄出去的信都保留原稿到这个档 
set SHELL=/bin/csh 
set showto 
set VISUAL=/usr/ucb/vi         ===>> 设定 editor 为 vi 
set toplines=6 
set verbose                    ===>> 相当於打 mail -v 的指令 
ignore apparently-to date errors-to from id in-reply-to \ 
       message-id precedence received references remailed-date \ 
       remailed-from return-path sent-by status via 
 
BY-wshu 
T- .forward的文件格式 
        把要 forward 的 E-mail 直接写进去就行了. 
-------------------------------------------------- 
$ cat .forward 
kftseng@ccnews.nchu.edu.tw 
-------------------------------------------------- 
        若是要 forward 给程式处理. 
        用.. 
-------------------------------------------------- 
$cat .forward 
"| /home/kftseng/bin/mail-handle > /home/kftseng/mbox" 
-------------------------------------------------- 
 
BY-dfbb,Godman 
Q-snmp编程 
R-read RFC 
ftp.u-aizu.ac.jp:/pub/doc/rfc 
cmu-snmp                -- free snmp develop sdk 
cmu-snum will no develop , as far as I know 
UC -davis will continute on it and release ucd-snmp, 
better than cmu-snmp 
 
 
HP-UX系统,在修改/etc/rc.config.d/mailsvrs后,mail 既发不出去,也不能接 
收,将上文件该为原来可以工作的内容,也没戏。应如何是好 
 
-- 
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: iris.sist.tsing] 

BBS水木清华站∶精华区