论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > Windows 操作教程
Tag:windows,xp,vista,密码,技巧,注册表,安装,分区,安全,瘦身,双系统,死机,激活,新手,服务,组策略,视频教程

如何在Linux下安装Sendmail服务器

文章类别:Windows 操作 | 发表日期:2011-11-4 8:57:21

Sendmail现在是最流行的邮件服务器,那我们来看看如何在Linux下安装Sendmail服务器。

  1、从www.sendmail.org下载最新的版本(这个snedmail倒是有必要升级为最新的版本,因为它的升级主要是安全漏洞问题)。这里说明的是用的sendmail-8.12.2.tar.gz

  2、cd /usr/local/src/

  3、把文件下载到:/usr/local/src中

  4、tar zxvf sendmail-8.12.2.tar.gz

  5、cd /usr/local/src/sendmail-8.12.2

  6、chmod go-w / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue

  7、chown root / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue

  8、cd /usr/local/src/sendmail-8.12.2/sendmail

  9、sh Build

  10、cd /usr/local/src/sendmail-8.12.2/cf/cf

  11、建立文件sendmail.mc内容如下,你可根据需要修改相应部分。

  divert(-1)

  dnl This is the macro config file used to generate the /etc/sendmail.cf

  dnl file. If you modify thei file you will have to regenerate the

  dnl /etc/sendmail.cf by running this macro config through the m4

  dnl preprocessor:

  dnl m4 /etc/sendmail.mc > /etc/sendmail.cf

  dnl You will need to have the Sendmail-cf pacage installed for this to work.

  include(`/usr/local/src/sendmail-8.12.2/cf')

  define(`confDEF_USER_ID',`8:12')

  OSTYPE(`linux')

  undefine(`UUCP_RELAY')

  undefine(`BITNET_RELAY')

  define(`confTO_CONNECT', `1m')

  define(`confTRY_NULL_MX_LIST',true)

  define(`confDONT_PROBE_INTERFACES',true)

  define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')

  define(`SMART_HOST',compaq.rd.xxx.com)

  <---这条用于(非HUB)缺省使用HUB发送邮件

  MASQUERADE_AS(`rd.xxx.com')

  <-------------------------

  FEATURE(`masquerade_entire_domain')

  <---这三条用于邮件地址伪装

  FEATURE(`masquerade_envelope')

  <-------------------------

  FEATURE(`smrsh',`/usr/sbin/smrsh')

  FEATURE(`mailertable',`hash -o /etc/mail/mailertable')

  FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')

  FEATURE(redirect)

  FEATURE(always_add_domain)

  FEATURE(use_cw_file)

  FEATURE(local_procmail)

  FEATURE(`access_db')

  FEATURE(`blacklist_recipients')

  FEATURE(`accept_unresolvable_domains')

  MAILER(smtp)

  MAILER(procmail)

  dnl We strongly recommend to comment this one out if you want to protect

  dnl yourself from spam. However, the laptop and users on computers that do

  dnl not hav 24x7 DNS do need this.

  dnl FEATURE(`relay_based_on_MX')

  12、sh Build install-cf

  13、groupadd smmsp

  14、useradd smmsp

  15、cd cd /usr/local/src/sendmail-8.12.2/sendmail

  16、sh Build install

  17、cd /usr/local/src/sendmail-8.12.2/makemap

  18、sh Build clean

  19、sh Build all

  20、sh Build install

  21、cd /usr/local/src/sendmail-8.12.2/

  22、在本域DNS主数据库文件中增加MX纪录:

  rd.xxx.com. IN MX 0 compaq

  注意修改相应部分。那个0是有几个邮件集中器的时候用于标记先后顺序的。当有好几个MX的时候,建议顺序写为10、20、30…

  23、在/etc/mail目录下创建access文件,内容类似如下:

  127.0.0.1 RELAY

  21.9.22 RELAY

  211.99.221.238 RELAY

  然后:makemap hash access.db < access

  24、创建文件/etc/mail/local-host-names,其内容为本机的拥有的域名信息。

  rd.xxx.com

  compaq.rd.xxx.com

  25、创建文件/etc/mail/aliases,内容类似:

  MAILER-DAEMON: postmaster

  postmaster: root

  bin: root

  daemon: root

  nobody: root

  运行newaliases创建数据库。

  创建别名文件的意义之一在于当邮件发往域中其他邮件服务器的用户而不是mail HUB用户的时候用。

  比如增加一条:

  atan: atan@fbsd

  则导致邮件发往mail HUB的时候自动转发到atan@fbsd.rd.xxx.com

  26、启动sendmail: /usr/sbin/sendmail -bd -q30m

  排错:如果有问题导致启动不了,大部分问题和DNS配置有关,可以使用nslookup检查DNS是否正常。挨个检查/etc/mail中的文件内容也是排错的好办法。另外,修改配置,不建议直接编辑sendmail.cf文件,建议使用m4宏编译工具,因为有些带有安全漏洞或过时的宏在编译的时候会有提示,这样以免造成相关安全问题。

  通过上面文章,我们应该了解了在Linux下安装Sendmail服务器的方法,希望对你们有帮助!

上一篇:{教程}Linux VPS一键安装包 人气:3028
下一篇:{教程}Linux下安装DNS+Sendmail服务 人气:2635
视频教程列表
文章教程搜索
 
Windows 操作推荐教程
Windows 操作热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058