当前位置:Linux教程 - Linux - 邮件系统详解

邮件系统详解

首先简单的介绍一下邮件系统,主要由两部分组成:smtp协议(简单邮件传输协议)
和pop3(邮局协议version
3),smtp用于邮件在网络中的传递(mailer),而pop处理
客户端邮件的接收。由于pop3的局限,将来肯定要被imap代替,imap有较好的目录

服务能力,可以在下载之前看到邮件的主要信息如来源、标题等,还可以远程删除

邮件等,但目前ISP还不会轻易用它来替换pop.注意不要与IAP的POP搞混淆了,那
是当前接入点的意思(Point Of
Present)。学得越多越糊涂:-(
最早在Linux传递邮件用的是smtp服务,在/etc/inetd.conf里可以看到这样一行:

#smtp stream tcp nowait root /usr/bin/smtpd smtpd

现在基本都用sendmail这样功能强大的deamon程序来做(nntp也是如此)。所以

sendmail只是邮件传递者(mailer),它把这个主机上的邮件发送到其他地方,注意
到配置DNS时有一项MX(Mail
eXchang,邮件网关),使用sendmail在你的网内要有一

个DNS服务器。而处理主机上远程客户的邮件服务则要有pop服务,查看inetd.conf
有这么几项:
pop-2
stream tcp nowait root /usr/sbin/tcpd ipop2d
pop-3 stream tcp nowait
root /usr/sbin/tcpd ipop3d
imap stream tcp nowait root
/usr/sbin/tcpd imap
再查看/etc/service就知道它们对应的端口号,用telnet host-name port试试能

看到什么?Linux这样的东西通常是用来做服务的,当然有很多人把它用作个人桌

面也不错,但是新手就不知道如何去收他们在ISP的邮件了,其实很简单,只需要

装个pop/imap的客户端软件就行了,netscape的套件就是很好的选择,KDE带的邮

件客户端软件也不错,支持多帐号,就是不直接支持中文(用zhXwin吧),或者用

fetchmail把邮件抓回来转发到本地主机的客户,在本地主机上用mail程序来读。

我感觉mail程序好象是直接处理邮件队列,不知对不对。使用mail程序问得最多
的问题是,在输入正文时怎么结束?另起一行输入一个"".""就行了!





上面讲的是现在internet上的邮件系统,在internet出现以前电子邮件系统就有了,

比如在uucp/BBS上,还有其它类型的网络上,就在internet发达的今天,这样的网

络系统仍然与之并存。AOL、赢海威(IHWY)的网络上就不是标准的Internet电子邮件。

我以前就上过电信局的基于X.25网(准确的说应该是中国公用分组交换数据网CHINAPAC)

的电子邮件系统,优点是真正的帐号漫游,缺点是速度太慢(至多9600bps,x.25本来就

不快),后来承诺要建一个X.400网关与Internet上的邮件系统转发信件,也不知道后来
怎样了,因为我早已不用它,在IP over
everthing的今天......



关于mail list功能,可以用sendmail的别名来做,或者用专门的软件
href=""http://infosite.heha.net/linux/[email protected]/pub/majordomo/default.htm"">majordomo.

到中国自由软件库或者
href=""http://ftp.swjtu.edu.cn/"">swjtu.edu.cn上去可以搜寻到。它的FAQ由
href=""http://www.cis.ohio-state.edu/~barr/default.htm"">barr维护。

至于WebMail,可以到
href=""http://www.perl.com/"">http://www.perl.com/上找找有没有现成的CGI.现成的软件其实也很多

如WeMail,
href=""http://www.lugs.ch/lugs/mitglieder/norbert.kuemin/wmf.html"">WebMail
Folder,WebMail Module(Roxen),
href=""http://www.fetchmail.com/"">Fetchmail(也可以哟,商业性的)

href=""http://horde.org/imp/default.htm"">IMP(IMAP WebMail)以及
href=""http://www.chaotika.net/code/HTMail"">HTMail。



参考北京俱乐部的文章:
href=""http://infosite.heha.net/linux/network/html/misc/network-sendmail_cf.html"">配置文件sendmail.cf的简单解释。


href=""http://infosite.heha.net/linux/network/html/misc/network-sendmail-bug.html"">关于sendmail老版本的一个安全漏洞


href=""http://infosite.heha.net/linux/network/html/misc/network-hotmail-bug.html"">关于hotmail的安全漏洞
(做WebMail一定要参考一下!)






罗罗嗦嗦写了一堆,希望对新新手有所帮助,下面是一些问答集:


href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#notify"">如何禁止console下新邮件到达提示



href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#start"">pop3启动起来了吗?





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#account"">如何建立一个邮件帐号?





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#cannot-send"">为什么能收不能发邮件?





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#error-on-get"">为什么突然不能收邮件?





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#pine"">配置pine去收pop3邮件





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#big"">sendmail如何据收大的信件?





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#about-dns-MX"">DNS里相关设置的问题





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#MX-firewall"">防火墙内外邮件网关的设置问题





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#redundancy"">邮件服务器双备份的设置问题





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#multi-domain"">sendmail支持多域名吗?





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#delete-mail"">如何删除未发出的邮件?





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#raner-tips"">raner写的tips





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#redhat5.1"">Redhat
5.1文档里的相关部分








发信人: rudey (huihui), 信区: Linux
标 题: Re: [求助]如何禁止新邮件到达提示?
发信站: BBS
水木清华站 (Mon Dec 7 01:00:38 1998)

: 比较烦人,可以去掉吗?

biff n







> 我做了LAN中的一个mail server(red hat 5.0 ,kernel
2.0.1),可为何只能在WIN95下用NETCAPE4.0发信,
> 而不能收信,它出现""pop3 server error""
信息。请问是否只需配置/etc/inetd.conf 和/etc/services
> 中pop3 服务,或还有别的配置?
另外如何判断我的server是否提供pop3服务,若没有,又请问如何配置
> (请详述程序安装和编译过程)?



到/usr/sbin下看一看有没有ipop3d, 如果没有的话就是你安装时偷懒没装,重装之。

实际上,安装RH5的时候,选择“Everything”,总共也没多少(6XXM+)又快又方便
(我只用9分钟),决不会出现你这种问题。



如果有的话,试一试telnet localhost 110, 没反应的话,应该是你的/etc/inetd.conf
有问题,
看看POP-3一行前面有没有#



注:简单地,用netstat -a | grep pop看看有没有下面的信息:
tcp 0 0
*:pop-2 *:* LISTEN
tcp
0 0 *:pop
*:* LISTEN




> 你好!我想做一个mailserver,但在建立pop3邮件服务器时,查到有qpopper与pop3d
>
两种服务程序可用,好象听说qpopper 能与window client相连,不过本人想比较具体
> 清楚二者有区别,请赐教!不胜感谢



没什么本质区别, pop-3协议极为简单,几百行程序而已,各种实现都差不多,犯不着为此
费心,高兴的话你可以自己写一个.

想知道区别的话,看看他们的源代码不就行了?想用好LINUX, 没有这点耐心和本事是不

行的.不要用各种""我是初学者....""之类的话给自己推卸责任,""从来就没有什么救世主,
一切都要靠我们自己!""






【 在 badi (都市夜归人) 的大作中提到: 】
: 【 在 cop (cop) 的大作中提到: 】
: :
在配置完邮件系统后,请问怎样使用, 在mail to XXX后出现subject, 添入
: :
后,不知怎样做了.另外sendmail后POP的使用场合的区别.用Windows做客户
: : 时,怎样用?
: 1.mail结束用"".""

: 2.需要qpopper,随便找一个ftp下来.
qpop好像是用明文做身份验证吧?听说apop可以解决这种问题,但是一直没有找到.



注:去找
href=""http://www.serc.rmit.edu.au/~tobbe/epop"">epop,把pop3客户端与服务端简洁地集成到一块,也支持apop的密文验证。





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK









> 我想在LAN中做一个pop3 mail server(slackware3.4),客户为win95的IE,或Netscape.
>
1. 在linux上试telnet localhost 110,反应为“+OK,POP3 server ready...”
> 2.
请问是否需要建立客户的有关信息(帐号、口令等等)?如何建立?
> 3. 请问下一步从何入手?或从那里查阅资料?(howto中似乎没有pop3
sever的说明)。



简单地,你只要在这台linux box上为用户开一个普通的帐号就万事大吉了。以后用户使
用同样的帐号和口令就可以同时登录和POP-3收信了。

POP-3其实简单的一塌糊涂,不信去看看源代码,极为简单。
-----
姚飞





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK








> 我现在的mail能够接收,但不能发送,发送时提示服务器拒发,这是怎么回事,上回那位
>
lh兄贴给我的DNS也不行,看过之后感觉非常乱,和通过HOWTO得到的概念好像完全是两码
> 事一样。



在/etc/mail/name_allow中加上你想允许的域或者子域就行了。
那是从RedHat 5.0开始增加的Anti-spam功能,

设置一下/etc/mail目录。
参考
href=""http://docs.shiuol.com.cn/rhmanual/manual/doc012.html"">http://docs.shiuol.com.cn/rhmanual/manual/doc012.html





> My sendmail version is v.8.
> I can both send email in linux box
and mail client of win95. But I can
> receive the pop3 email sent in
linux box only. I don''t know why.
> When I telnet localhost 25 and telnet
localhost 110 in linux box, they are
> all OK.
你的意思我想是这样的:



你通过linuxbox作为pop3和smtp服务器,让他去收发信件,你在另外一台瘟95的机器上阅读。
现在呢,你装了RedHat5.1,
发现不能通过SMTP转发出去,也不能收到ISP上的邮件,是吧?
现在我就是这样的,让他每天晚上2:00自动拨号收发邮件.



首先,你要定时运行fetchmail,从你的ISP那里把邮件取回来,存到这个LINUX上,具体设置,
最好看看man
fetchmail,很详细,很简单。



RH5.1取消了缺省的SMTP转发功能, 你如果要用,请把你的瘟95机器的IP地址写到

/etc/mail/ip_allow及/etc/mail/relay_allow两个文件里, 一个IP写一行.






>>>>>>> problem:

>>>>>>> I configured sendmail.cf and
install pop3. I can send mail
>>>>>>> from Linux
command line with mail command to outside.
>>>>>>> but
we can''t send mail from a pc mail to outside.
>>>>>>>
error message :
>>>>>>> The mail server responded:

>>>>>>> <...@.......> We do not relay

>>>>>>> why?



>>>>>>
又是这种老的掉牙的问题。把你的客户机的地址写到/etc/mail/ip_allow里,重启动sendmail.



>>>>> 如果想所有机器都可以是客户机,如何去写?



>>>> 把所有客户机的地址都填进去,一行写一个,比如:
>>>> xxx.xxx.xxx.1

>>>> xxx.xxx.xxx.2
>>>> xxx.xxx.xxx.3



>>> 最好能设定地址范围或网段定义邮件客户机。因为本人因工作关系,掌控
>>>
16个C类IP,如果是一行一个ip这样Linux的mail客户机设定就太麻烦了。
>>>
如果mail客户出差在外,希望通过internet远程取电子邮件,其不是要抓瞎。
>>> 我想linux的mail设定不会仅仅如此吧。




>> Class C
>> aaa.bbb.ccc
>> class b
>>
aaa.bbb
>> class a
>> aaa
>> --
>> Sida




> 本来RedHat 5.0以前的版本没这东西,只不过发现好多人用RedHat Linux发送垃圾邮件,
> 这才不得已加上的.
你完全可以改改sendmail.cf去掉这些限制. 再说了, 写个perl脚
> 本生成这个文件又不费事.



谢谢姚飞及各位大侠。My linux mail server is ok now!




href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK







>>> 各位好!
>>>
我在SlackWare3.4上建立了一个用户,只能发邮件,不能收邮件;而另一用户就可
>>>
以。另有一用户一直可以收发邮件,突然不能收邮件。(在Slackware3.4上正常,在
>>>
Client端[IE]老提示密码错误,若邮箱为空,则一切正常。)望各位帮帮忙。



>> 把 /var/tmp/.pop/ 下面的文件删掉就行了。



> 请问这几个文件是怎样形成的?
> ls /var/tmp/.pop
> xxx
> yyy

> zzz



when somebody downloading mail by pop3, but have some problem(like:

passwd error, lost carrier....).




href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK








发信人: pear (大鸭梨), 信区: Linux
标 题: 如何在Pine中收取POP3服务器中的信件
发信站: 广州网易 BBS
(Mon Nov 23 18:36:13 1998), 转信



在使用Linux的过程中,上网收取信件也是一件经常要做的工作.使用Xwindow+

Netscape的朋友可能就没有什么问题.可是仍有些人在使用字符界面,他们仍然用

Pine作为收发邮件的工具.Pine的初始设置是读取本地服务器的邮件,如何用Pine
来读取POP3服务器上的邮件呢?

方法如下:在Pine的设置文件($HOME/.pinerc)中加入
Inbox Path =
{YourPopServer/pop3/user=YourName}INBOX
然后重新启动Pine即可.

注:在pine里直接选setup配置也可以。还要配置smtp-server去发信。




href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK







标 题: Re: sendmail如何据收大的信件?
发信站: BBS 水木清华站 (Mon Nov 30 17:24:15 1998)



O MaxMessageSize=1000000在
/etc/sendmail.cf中




href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK








>> Dear Ladies and Gentlemen,
>> My DNS server and mail
server are installed on the same machine.
>> And the machine name is
just the domain name. Before I installed
>> DNS, the sendmail worked.
But After I installed DNS, I got
>> a error message returned to the
postmaster said:
>> 553 3lab.org. Config error: mail loops back to me
(MX problem?)
>> 554 ... Local configuration
error
>> In the named.hosts, there is a line read ''MX 10 3lab.org.''.

>> ''3lab.org'' is either my domain name and my host name.
>>
Is anything wrong?



> 不要把hostname和domain name搞成一样,我想你是想让你的邮件地址变成
> [email protected]
.这才想当然地采用了这么个办法。
> 实际上,你完全可以给这台机器起任何名字,假设是server.3lab.org ,
>
那么,在DNS的zone文件里设置
>
> 3lab.org
IN MX 10 server.3lab.org

>
IN NS
server.3lab.org
>
> @ORIGIN 3lab.org
>
server IN A
a.b.c.d

>
IN CNAME ns

>
IN CNAME mail
>
>
然后,在/etc/sendmail.cw里加上3lab.org就可以了。
> 看来你要好好学习一下DNS 。



Hello Yao fei,
It was settled. Thank you.
There is no
/etc/sendmail.cw file in my linux.
But I did find a ''Cwlocalhost'' item in
the
/etc/sendmail.cf file. So I changed that clause
to ''Cwgtt.me'', then
it works.




> Another thing that I don''t inderstand is the
> differences
between ''Cwxxx'' and ''DMxxx''.



Dm是指本机发出的Email域的地址。
Cw是指本机接收的Email域的地址。
--
Sida





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK







>>> 装了一个 Linux 想做email server,但是因为使用防火墙,我的Linux的ip不是合法ip,

>>> 因此想采用mail exchanger来实现收internet email,在申请域名的时候加了一个

>>> mail exchangre ,以前在学校里的时候用NT服务器收信成功过,但是现在每次发信给我

>>> 的Linux ,都会收到mail exchanger 的信,告诉我host unknown,请教各位高手应该怎么办?



>> 域名MX(mail exchange)是转换域到主机,主机一定要是合法IP!
>>
“以前在学校里的时候用NT服务器收信成功过”肯定不是用这种方法。
>>
Firewall后的mail主机,需要在Firewall上设置portmap.
>> --
>> Sida



> 可是的确有人这么做是可以的,而我就不知道怎么总是不成功..:(再请教一下,这个
> portmap是个啥东东?应该怎样设置?

> 多谢了!



我想不可能吧,MX肯定不行。你大概是指的mail router(找不到好说法了,
用netscape mail
server的吧)。就是有一台合法主机,它做网关,把MX指
向它,它再把某些域名的的信转发内部网的机器上。如a公司有一合法IP

202.96.238.123, 202.96.238.123这台机器有双网卡,内部地址是192.168.2.1,

a.com的MX指向202.96.238.123(合法),tech.a.com的MX也指向202.96.238.123,

但内部tech部的可用192.168.2.100来收信。因为202.96.238.123把信转给了192.168.2.1.

我说的很不清楚,不知你是不是这个意思。




> I have a big problem. Here is the scenario:
> Our corporate email
system is Microsoft Exchange (NT-based). However, our
> internet gateway,
and also SMTP Relay host, is Linux/sendmail. Our MX
> record points to
the Linux machine (glory.prio.no, 194.19.122.161). When
> sendmail
receives something it doesn''t know the address of (say
> [email protected]),
and who IS a user in Exchange, it bounces the mail.



sendmail on linux box is probably setup to accept mail for [email protected]

If the scenario is like this ""there are some [email protected] who are on

linux and some [email protected] who are on linux"", you can use aliases to

forward the nt users email to forward to NT smtp(I hope) server.

Otherwise, change sendmail.cf so that it doesn''t call itself prio.no, only

glory.prio.no



To change sendmail.cf, find a line with the text ""Cw"" at the begininning,

and remove only prio.no from that line leaving ""Cw"" with anything else or

even blank.



> How can I set it up to forward all mail from unknown users to the SMTP

> connector on NTSPRIO2 (ntsprio2.prio.no, 194.19.122.162), which is our

> Exchange server? The Exchange SMTP program already transfers all
outbound
> mail through the Linux box (has it set up as an SMTP relay
host), but, as
> I''ve pointed out, doesn''t want to receive mail because
sendmail is
> incorrectly set up.



In your sendmail.mc put these lines :
FEATURE(mailertable, hash
/etc/mail/mailertable)
define(``LUSER_RELAY'', ntsprio2.prio.no)dnl



And in mailertable

prio.no
esmtp:ntsprio2.prio.no
.prio.no
esmtp:ntsprio2.prio.no





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK







> 大家好!
>
>
近日碰到这样一个问题,我想给单位的邮件服务器hostA,配备
> 一台次邮件服务器hostB,以防备hostA在down机或忙的时候落掉邮件,

> 现在DNS的设置已经好了,假设如下:
>
>
domain.my
in MX 10 hostA.domain.my.

>
in MX 20 hostB.domain.my.
>
>
hostA
in A xxx.xxx.xxx.50
>
hostB
in A xxx.xxx.xxx.51
>
> hostA、hostB均安装使用的 RedHat
5.1+sendmail .
> 在hostA 的sendmail.cw 设置好, domain.my 的域名。
>

> ok!现在将hostA 故意当掉!另找台机器 hostC 来试试:
> ----------------------

> #:sendmail -v [email protected]
> test
> test
> .

> [email protected]... Connecting to hostA.domain.my. Via esmtp...

> [email protected]... Connecting to hostB.domain.my. Via esmtp...

> ...
> ...
> ...
>
> 看来hostB是接收了次信,但是hostB
并没有把此信再转给 hostA.
> hostB 告诉我:
>
> 553 hostB.domain.my.
Config error: mail loops back to me (MX problem?)
> 554
... Local configuration error
>
> 我不知
hostB 的sendmail 该如何配置,那位大虾给我解答解答,先谢了!



如果HOSTB relay域名domain.my,并且w类不设置domain.my的话,配置应该没
问题,可能是启动sendmail时用-q1h,
HOSTB在1小时后处理queue才转发给HOSTA吧.
--
Sida





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK








标 题: Re: 求教!Sendmail能否支持多域名?
发信站: 广州网易 BBS (Tue Oct 13 08:38:29 1998), 转信




【 在 send (流浪猫) 的大作中提到: 】
: 各位大虾:
: 能否让sendmail支持多域名?或着有没有别的
:
邮件服务器软件可以做到!
: 谢谢!
在/etc/sendmail.cf 中加一行:Fw/etc/sendmail.cw

然后在/etc目录下生成文件sendmail.cw,把所有的域名写到里面,就行了。
当然,你预先要为你的机器申请这些域名。






href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK








> Please , who can say how to remove my mail from the sendmail queue if I

> have send it bu sendmail still has it in its queue and I don''t want
that
> mail to be sent.



Better than that ... Has an interface to the sendmail daemon been written.

A sendmail administrator and manager. Something that would help the

system adminstrator manage the queue (ie. Send now, rm, etc.) and other

configurable aspects of sendmail outside of sendmail.cf and its

commandline options? I don''t think sendmail, mailq, nor newaliases has

that feature.



>> if you are root just go to /usr/spoolmqueue and delete the
appropriate
>> file. Otherwise, it''ll probably be sent next time
sendmail rolls around.,



> But isn''t there better way to do it. Because it is hard to quickly

> determine the appropriate file(s) in /var/spool/mqueue.



Running mailq to list the messages in the queue will give you a good idea

of the filename to delete.



There is no real ''easy'' way to find the specific message. You can use
the
mqueue program (a symbolic link to sendmail which is the
equivalent of
sendmail -bp) to find your message. If you have time to
remove just one file
then remove the ''qf'' file. The ''df'' file holds the
text, but the sendmail
does not attempt to deliver a message which has
a data file but no queue
file.
Of course, the best method is to not send the message in the first
place.
If you are not the root user, then there is no recall function. A
message
sent is sent.




href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK








发信人: raner (毕设好无聊呀!), 信区: Linux
标 题: 关于sendmail的别名和forward
发信站:
BBS 水木清华站 (Sat Apr 11 15:51:29 1998)



都是一些sendmail的小玩意, 经常有人会问, 整理一下



(1) 关于直接用IP地址发信



mail user@[166.111.IP.Address]

只要用[]将IP地址括起来就行了



(2) 关于alias



sendmail在/etc下有两个文件 aliases和aliases.db,
后者是前者用newaliases
生成的别名数据库. 你可以手工编辑/etc/aliases,
然后运行newaliases更新数据
库(其实newaliases是个到sendmail的
symlink)



eg: nickname : [email protected]

alias-name:
real-user-account



则以后mail nickname就可以将信寄到[email protected]

而别人寄给[email protected]的信就会转给真正的用户real-user-account



(3) 关于forward



在你的$HOME目录下面编辑一个.forward文件, 里面写上你要forward的目的e-mail

地址或本机的用户名, 就可以自动将信 forward到相应地址



eg: .forward: [email protected]


或 other-user-account

则给此人的e-mail会forward到hotmail或other-user-account处



(4) 关于vacation



去找一个vacation包(如RedHat的contrib中有vacation的rpm), 装上后就一个

/usr/bin/vacation程序和一个man.



先运行vacation, 它会让你编辑$HOME/.vacation.msg文件, 就是要发回给对方

告诉他你现在不看信的东西啦. 然后编辑$HOME/.forward文件, 写这样一句

username, ""|/usr/bin/vacation username"", username
要换回你自己的了
然后运行vacation -I建立$HOME/.vacation.db就好了
(看看man更详细)



(5) 关于sendmail的一些文件



/var/log/maillog sendmail的log,
分析错误有用
/var/spool/mail/$USER 进来的信, 每个用户一个文件

/var/spool/mqueue mail queue, 可以用mailq看队列中待发的信


(mailq也是 sendmail的symlink了)
dfxxxxxx 这是信的内容

qfxxxxxx 这是信的subject和别的信息 (反正每信一个号了, 配对的)




/etc/sendmail.cf sendmail的配置文件,
改动它可要小心
/etc/sendmail.cw
假如你的机器有好多alias的话就把名字写在


这个文件中, 这样写哪个都能收到信



-------
raner





href=""http://infosite.heha.net/linux/network/html/misc/sendmailabout.html#head"">BACK








摘自<> 供懒人们阅读



11.5 Sendmail



一个默认的sendmail.cf文件将被安装在/etc下。该配置文件可工作于仅使用SMTP的站点。而不能工作于UUCP

站点;如果您要使用UUCP进行邮件传输就得重新生成一个新的sendmail.cf。这样的话,您就需要安装m4和

sendmail的源代码包。请您阅读sendmail 源代码中的README以获取更为详尽的创建snedmail配置文件的方
法。也可以看
O''Reilly&Associates出版的一本有关sendmail的不错的参考书(作者:Bryan Costales).



一种常用的sendmail的配置用一台机器作为网络中所有主机的邮件网关。打个比方,在红帽子软件公司我

们有一台地址为mail.redhat.com的机器来处理我们所有的邮件。 我们只需简单的将mail.redhat.com要

处理邮件的机器的名字加入/etc/sendmail.cw。下面 是该文件的一个例子:



# sendmail.cw - include all aliases for your machine

# here.
torgo.redhat.com

poodle.redhat.com
devel.redhat.com




同样在torgo,poodle和devel的那些机器中编辑/etc/sendmail.cf,使其象mail.redhat.com 那样发送邮

件,转发本地的邮件给redhat.com。 编辑含DH和DM的那些行:



# who I send unqualified names to
#
(null means deliver locally)
Drmail.redhat.com



# who gets all local email traffic

Dhmail.redhat.com



# who I masquerade as (null for no masquerading)

Dmredhat.com



以这种配置,所有发出的邮件都好象是从redhat.com发出的,而任何发往torgo.redhat.com 和其它机器

的邮件都将发送给mail.redhat.com



请注意,如果您将您的系统配置为以另一机器身份发送邮件的话,任何以本系统为目的的邮件都将被发送

至那台主机。比如,由cron进程定期产生的发网[email protected] 日志文件都将发送给

[email protected]




E.10.3 我已经升级到 5.0 , sendmail 不再像以前一样传送邮件 .该做什么 ?



由于多方面的电子邮件商使用未知的 Red Hat 系统发送邮件和一些其他问题, 在 5.0 中, 我们将(不作
为邮件传递者)作为缺省选项 .




你可以将你允许传递邮件的系统名称加入到文件
/etc/relay_allow



web 站点
href=""http://www.informatik.uni-kiel.de/~ca/email/check.html"">http://www.informatik.uni-kiel.de/~ca/email/check.html

将告诉你更多关于这方面的信息 .



如果你希望某些发送垃圾邮件的站点不能访问到你的计算机, 你可以使用 sendmail 的一些新特性
拒绝他们的访问. 将这些站点的地址加入到文件
/etc/mail/deny 中, 然后为它生成一个散列表 .



下面的命令可以生成这种散列表 .



makemap -v hash /etc/mail/deny < /etc/mail/deny