network-sendmail.html

来自「学习linux的工具书」· HTML 代码 · 共 535 行 · 第 1/3 页

HTML
535 行
字号
<br>> ...
<br>> ...
<br>> ...
<br>>
<br>> 看来hostB是接收了次信,但是hostB 并没有把此信再转给 hostA.
<br>> hostB 告诉我:
<br>>
<br>> 553 hostB.domain.my. config error: mail loops back to me (MX problem?)
<br>> 554 &lt;master@domain.my>... Local configuration error
<br>>
<br>> 我不知 hostB 的sendmail 该如何配置,那位大虾给我解答解答,先谢了!
<p>如果HOSTB relay域名domain.my,并且w类不设置domain.my的话,配置应该没
<br>问题,可能是启动sendmail时用-q1h, HOSTB在1小时后处理queue才转发给HOSTA吧.
<br>--
<br>Sida
<br>&nbsp;
<p><blink><a href="#head">BACK</a></blink>
<br>&nbsp;
<p><a NAME="multi-domain"></a>
<p>标 题: Re: 求教!sendmail能否支持多域名?
<br>发信站: 广州网易 BBS (Tue Oct 13 08:38:29 1998), 转信
<p>【 在 send (流浪猫) 的大作中提到: 】
<br>: 各位大虾:
<br>: 能否让sendmail支持多域名?或着有没有别的
<br>: 邮件服务器软件可以做到!
<br>: 谢谢!
<br>在/etc/sendmail.cf 中加一行:Fw/etc/sendmail.cw
<br>然后在/etc目录下生成文件sendmail.cw,把所有的域名写到里面,就行了。
<br>当然,你预先要为你的机器申请这些域名。
<br>&nbsp;
<p><blink><a href="#head">BACK</a></blink>
<br>&nbsp;
<p><a NAME="delete-mail"></a>
<p>> Please , who can say how to remove my mail from the sendmail queue
if I
<br>> have send it bu sendmail still has it in its queue and I don't want
that
<br>> mail to be sent.
<p>Better than that ... has an interface to the sendmail daemon been written.
<br>A sendmail administrator and manager. Something that would help the
<br>system adminstrator manage the queue (ie. send now, rm, etc.) and other
<br>configurable aspects of sendmail outside of sendmail.cf and its
<br>commandline options? I don't think sendmail, mailq, nor newaliases
has
<br>that feature.
<p>>> if you are root just go to /usr/spoolmqueue and delete the appropriate
<br>>> file. Otherwise, it'll probably be sent next time sendmail rolls
around.,
<p>> But isn't there better way to do it. Because it is hard to quickly
<br>> determine the appropriate file(s) in /var/spool/mqueue.
<p>Running mailq to list the messages in the queue will give you a good
idea
<br>of the filename to delete.
<p>There is no real 'easy' way to find the specific message. You can use
<br>the mqueue program (a symbolic link to sendmail which is the
<br>equivalent of sendmail -bp) to find your message. If you have time
to
<br>remove just one file then remove the 'qf' file. The 'df' file holds
the
<br>text, but the sendmail does not attempt to deliver a message which
has
<br>a data file but no queue file.
<br>Of course, the best method is to not send the message in the first
place.
<br>If you are not the root user, then there is no recall function. A message
<br>sent is sent.
<p><blink><a href="#head">BACK</a></blink>
<br>&nbsp;
<p><a NAME="raner-tips"></a>
<p>发信人: raner (毕设好无聊呀!), 信区: Linux
<br>标&nbsp; 题: 关于sendmail的别名和forward
<br>发信站: BBS 水木清华站 (Sat Apr 11 15:51:29 1998)
<p>&nbsp;都是一些sendmail的小玩意, 经常有人会问, 整理一下
<p>&nbsp;(1) 关于直接用IP地址发信
<p>&nbsp;&nbsp;&nbsp;&nbsp; mail user@[166.111.IP.Address]
<br>&nbsp;&nbsp;&nbsp;&nbsp; 只要用[]将IP地址括起来就行了
<p>&nbsp;(2) 关于alias
<p>&nbsp;&nbsp;&nbsp;&nbsp; sendmail在/etc下有两个文件 aliases和aliases.db,
后者是前者用newaliases
<br>&nbsp;&nbsp;&nbsp;&nbsp; 生成的别名数据库. 你可以手工编辑/etc/aliases,
然后运行newaliases更新数据
<br>&nbsp;&nbsp;&nbsp;&nbsp; 库(其实newaliases是个到sendmail的 symlink)
<p>&nbsp;&nbsp;&nbsp;&nbsp; eg:&nbsp; nickname : user@hotmail.com
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alias-name:&nbsp;
real-user-account
<p>&nbsp; 则以后mail nickname就可以将信寄到user@hotmail.com处
<br>&nbsp; 而别人寄给alias-name@your.domain.name的信就会转给真正的用户real-user-account
<p>&nbsp;(3) 关于forward
<p>&nbsp;&nbsp;&nbsp; 在你的$HOME目录下面编辑一个.forward文件, 里面写上你要forward的目的e-mail
<br>&nbsp;&nbsp;&nbsp; 地址或本机的用户名, 就可以自动将信 forward到相应地址
<p>&nbsp;&nbsp;&nbsp; eg: .forward:&nbsp; user@hotmail.com
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 或&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
other-user-account
<br>&nbsp;&nbsp;&nbsp; 则给此人的e-mail会forward到hotmail或other-user-account处
<p>&nbsp;(4) 关于vacation
<p>&nbsp;&nbsp;&nbsp; 去找一个vacation包(如RedHat的contrib中有vacation的rpm),
装上后就一个
<br>&nbsp;&nbsp;&nbsp; /usr/bin/vacation程序和一个man.
<p>&nbsp;&nbsp;&nbsp; 先运行vacation, 它会让你编辑$HOME/.vacation.msg文件,
就是要发回给对方
<br>&nbsp;&nbsp;&nbsp; 告诉他你现在不看信的东西啦. 然后编辑$HOME/.forward文件,
写这样一句
<br>&nbsp;&nbsp;&nbsp;&nbsp; \username, "|/usr/bin/vacation username",
username 要换回你自己的了
<br>&nbsp;&nbsp;&nbsp; 然后运行vacation -I建立$HOME/.vacation.db就好了
(看看man更详细)
<p>&nbsp;(5) 关于sendmail的一些文件
<p>&nbsp;&nbsp; /var/log/maillog&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sendmail的log,
分析错误有用
<br>&nbsp;&nbsp; /var/spool/mail/$USER 进来的信, 每个用户一个文件
<br>&nbsp;&nbsp; /var/spool/mqueue&nbsp;&nbsp;&nbsp;&nbsp; mail queue,
可以用mailq看队列中待发的信
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(mailq也是 sendmail的symlink了)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dfxxxxxx 这是信的内容
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qfxxxxxx 这是信的subject和别的信息 (反正每信一个号了,
配对的)
<p>&nbsp;&nbsp; /etc/sendmail.cf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sendmail的配置文件,
改动它可要小心
<br>&nbsp;&nbsp; /etc/sendmail.cw&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 假如你的机器有好多alias的话就把名字写在
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
这个文件中, 这样写哪个都能收到信
<p>-------
<br>raner
<br>&nbsp;
<p><blink><a href="#head">BACK</a></blink>
<br>&nbsp;
<p><a NAME="redhat5.1"></a>
<p>摘自&lt;&lt;RedHat 5.1安装指南>>&nbsp;&nbsp;&nbsp; 供懒人们阅读
<p>11.5 Sendmail
<p>一个默认的sendmail.cf文件将被安装在/etc下。该配置文件可工作于仅使用SMTP的站点。而不能工作于UUCP
<br>站点;如果您要使用UUCP进行邮件传输就得重新生成一个新的sendmail.cf。这样的话,您就需要安装m4和
<br>sendmail的源代码包。请您阅读sendmail 源代码中的README以获取更为详尽的创建snedmail配置文件的方
<br>法。也可以看 O'Reilly&amp;Associates出版的一本有关sendmail的不错的参考书(作者:Bryan
Costales).
<p>一种常用的sendmail的配置用一台机器作为网络中所有主机的邮件网关。打个比方,在红帽子软件公司我
<br>们有一台地址为mail.redhat.com的机器来处理我们所有的邮件。 我们只需简单的将mail.redhat.com要
<br>处理邮件的机器的名字加入/etc/sendmail.cw。下面 是该文件的一个例子:
<p>&nbsp;&nbsp;&nbsp; # sendmail.cw - include all aliases for your machine
<br>&nbsp;&nbsp;&nbsp; # here.
<br>&nbsp;&nbsp;&nbsp; torgo.redhat.com
<br>&nbsp;&nbsp;&nbsp; poodle.redhat.com
<br>&nbsp;&nbsp;&nbsp; devel.redhat.com
<p>同样在torgo,poodle和devel的那些机器中编辑/etc/sendmail.cf,使其象mail.redhat.com
那样发送邮
<br>件,转发本地的邮件给redhat.com。 编辑含DH和DM的那些行:
<p>&nbsp;&nbsp;&nbsp; # who I send unqualified names to
<br>&nbsp;&nbsp;&nbsp; # (null means deliver locally)
<br>&nbsp;&nbsp;&nbsp; DRmail.redhat.com
<p>&nbsp;&nbsp;&nbsp; # who gets all local email traffic
<br>&nbsp;&nbsp;&nbsp; DHmail.redhat.com
<p>&nbsp;&nbsp;&nbsp; # who I masquerade as (null for no masquerading)
<br>&nbsp;&nbsp;&nbsp; DMredhat.com
<p>以这种配置,所有发出的邮件都好象是从redhat.com发出的,而任何发往torgo.redhat.com
和其它机器
<br>的邮件都将发送给mail.redhat.com
<p>请注意,如果您将您的系统配置为以另一机器身份发送邮件的话,任何以本系统为目的的邮件都将被发送
<br>至那台主机。比如,由cron进程定期产生的发网root@poodle.redhat.com 日志文件都将发送给
<br>root@mail.redhat.com。
<br>&nbsp;
<p>E.10.3 我已经升级到 5.0 , sendmail 不再像以前一样传送邮件 .该做什么
?
<p>由于多方面的电子邮件商使用未知的 Red Hat 系统发送邮件和一些其他问题,
在 5.0 中, 我们将(不作
<br>为邮件传递者)作为缺省选项 .
<p>你可以将你允许传递邮件的系统名称加入到文件
<br>/etc/relay_allow
<p>web 站点<a href="http://www.informatik.uni-kiel.de/~ca/email/check.html">http://www.informatik.uni-kiel.de/~ca/email/check.html</a>
<br>将告诉你更多关于这方面的信息 .
<p>如果你希望某些发送垃圾邮件的站点不能访问到你的计算机, 你可以使用 sendmail
的一些新特性
<br>拒绝他们的访问. 将这些站点的地址加入到文件 /etc/mail/deny 中, 然后为它生成一个散列表
.
<p>下面的命令可以生成这种散列表 .
<p>&nbsp;&nbsp;&nbsp; makemap -v hash /etc/mail/deny &lt; /etc/mail/deny
<br>&nbsp;
<p>&nbsp; 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?