RedHat6.2服务器配置方案大全(六):Sendmail
|
作者:汤海京 第六章Sendmail 6.1简介 邮件服务是用户所需要的最重要的网络服务。Web的通信量很大,但邮件主要用于个人之间的通信,而人-人的通信是商务的基础。没有邮件服务的网络是不完整的网络。换句话说,如果不能给用户提供完整的TCP/IP下的邮件支持,这样的网络操作系统也不值得信赖。 源代码网整理以下配置sendmail是一件大而复杂的工作,但也不完全都是这样,与其他一些网络服务器系统只安装SMTP服务器软件的情况相比,Linux已经配置好了多数的设置。在多数系统下,缺省配置都能良好的运行。我将在本章中给出一些配置的建议,主要的一些配置参数建议大家不要随意更改。 源代码网整理以下文件来源 源代码网整理以下/etc/sendmail.cfsendmail-8.9.3-20.i386.rpm 源代码网整理以下/etc/sendmail.cwsendmail-8.9.3-20.i386.rpm 源代码网整理以下6.2.2相关工具: 源代码网整理以下文件来源 源代码网整理以下/etc/rc.d/init.d/sendmail sendmail-8.9.3-20.i386.rpm 源代码网整理以下作用: 源代码网整理以下控制sendmail运行时的配置。完整的sendmail配置应该包括7部分: 源代码网整理以下LocalInfo(本地信息):这部分定义了本地主机的信息 源代码网整理以下Options(选项):用来设置定义sendmail环境的选项。 源代码网整理以下MessagePrecedence(消息的优先级):sendmail消息的优先级 源代码网整理以下TrustedUsers(信任用户):定义发送邮件时允许改变发送地址的用户 源代码网整理以下FormatofHeaders(头格式):定义在sendmail中插入的邮件头信息 源代码网整理以下RewritingRules(改写规则):这部分保存着改写邮件地址命令使用该命令可以将邮件地址从用户邮件程序的地址形式改写为邮件发送程序所需要的地址形式。 源代码网整理以下MailerDefinition(邮寄者说明):定义发送邮件的程序,改写规则是邮件者使用的规则,在本部分定义。 源代码网整理以下其实,配置一个完整的sendmail服务器是一件极其复杂的工程,然而对于我们所适用的范围来说,很多的功能是没有必要的,所以我想以一个简单的例子来说明我们的配置,也就是说,没有被提出的配置在一般情况下是不需要我们的管理员来考虑的,你按照默认的做就可以了。 源代码网整理以下实例: 源代码网整理以下V8/Berkeley 源代码网整理以下Cwlocalhost 源代码网整理以下Fw/etc/sendmail.cw 源代码网整理以下CP. 源代码网整理以下DYuunet.uu.net 源代码网整理以下CPUUCP 源代码网整理以下DSthj.mycompany.com 源代码网整理以下CO@%! 源代码网整理以下C.. 源代码网整理以下C[[ 源代码网整理以下Kmailertablehash-o/etc/mail/mailertable 源代码网整理以下#制作db库 源代码网整理以下Kdomaintablehash-o/etc/mail/domaintable 源代码网整理以下Kgenericshash-o/etc/mail/genericstable 源代码网整理以下Kvirtuserhash-o/etc/mail/virtusertable 源代码网整理以下Kaccesshash-o/etc/mail/access 源代码网整理以下Kmxservedbestmx-z:-T 源代码网整理以下Kresolvehost-a-T 源代码网整理以下FR-o/etc/mail/relay-domains 源代码网整理以下DR 源代码网整理以下DH 源代码网整理以下Kdequotedequote 源代码网整理以下CMroot 源代码网整理以下DMthj.mycompany.com 源代码网整理以下#设置邮件服务器名称 源代码网整理以下DnMAILER-DAEMON 源代码网整理以下CPREDIRECT 源代码网整理以下DZ8.9.3 源代码网整理以下OSevenBitInput=False 源代码网整理以下OEightBitMode=pass8 源代码网整理以下OAliasWait=10 源代码网整理以下OAliasFile=/etc/mail/aliases,/etc/mail/majordomo 源代码网整理以下OMinFreeBlocks=100 源代码网整理以下#规定最小空闲块 源代码网整理以下OMaxMessageSize=1000000 源代码网整理以下#指定用户一次最大发送的邮件大小 源代码网整理以下OBlankSub=. 源代码网整理以下OHoldExpensive=False 源代码网整理以下ODeliveryMode=background 源代码网整理以下OAutoRebuildAliases=true 源代码网整理以下OTempFileMode=0600 源代码网整理以下OHelpFile=/etc/mail/sendmail.hf 源代码网整理以下OSendMimeErrors=True 源代码网整理以下OForwardPath=$z/.forward.$w:$z/.forward 源代码网整理以下OConnectionCacheSize=2 源代码网整理以下OConnectionCacheTimeout=5m 源代码网整理以下OUseErrorsTo=False 源代码网整理以下OLogLevel=9 源代码网整理以下#记录到日志文件的事件等级 源代码网整理以下OCheckAliases=False 源代码网整理以下OOldStyleHeaders=True 源代码网整理以下OPrivacyOptions=authwarnings,noexpn,novrfy 源代码网整理以下OQueueDirectory=/var/spool/mqueue 源代码网整理以下OTimeout.queuereturn=4d 源代码网整理以下OTimeout.queuewarn=4h 源代码网整理以下OSuperSafe=True 源代码网整理以下OStatusFile=/var/log/sendmail.st 源代码网整理以下ODefaultUser=8:12 源代码网整理以下OSmtpGreetingMessage=$jSendmail$v/$Z;$b 源代码网整理以下OUnixFromLine=From$g$d 源代码网整理以下OOperatorChars=.:%@!^/[]+ 源代码网整理以下Pfirst-class=0 源代码网整理以下Pspecial-delivery=100 源代码网整理以下Plist=-30 源代码网整理以下Pbulk=-60 源代码网整理以下Pjunk=-100 源代码网整理以下Ft-o/etc/mail/sendmail.ct 源代码网整理以下Troot 源代码网整理以下Tdaemon 源代码网整理以下Tuucp 源代码网整理以下R$*$#error$@5.7.1$:"550Relayingdenied" 源代码网整理以下#以上是Linux默认的选项,不允许客户机使用mail服务器收发邮件,如果允许客户机收发的话应将上边一句话改成 源代码网整理以下R$-$@ok 源代码网整理以下#注意:中间是两个tab键 源代码网整理以下#一下是邮件头信息 源代码网整理以下H?P?Return-Path:<$g> 源代码网整理以下HReceived:$?sfrom$s$.$?_($?s$|from$.$_) 源代码网整理以下H?D?Resent-Date:$a 源代码网整理以下H?D?Date:$a 源代码网整理以下H?F?Resent-From:$?x$x<$g>$|$g$. 源代码网整理以下H?F?From:$?x$x<$g>$|$g$. 源代码网整理以下H?x?Full-Name:$x 源代码网整理以下H?M?Resent-Message-Id:<$t.$i@$j> 源代码网整理以下H?M?Message-Id:$t.$i@$j 源代码网整理以下#以上是邮件头信息 源代码网整理以下2.管理员需要执行touch/etc/mail/aliases和touch/etc/mail/majordomo来创建两个文件,然后重新启动sendmail,利用sendmail.cf里生成db库的配置来生成两个库文件:aliases.db和majordomo.db;当然,管理员也可以通过执行makemaphashmailertable 源代码网整理以下2.管理员通过执行fetchmail-uyournameyourserver来为没有邮件用户制定他们的口令,用户需要在客户端作相应的设置。 源代码网整理以下3.管理员应该打开pop3服务,即更改配置文件 源代码网整理以下4.管理员在服务器上可以通过执行echotest|/usr/sbin/sendmail-vthj@mycompany.com来测试建立好的邮件用户是否能够正常工作。 |
