如何在Linux下安装Sendmail服务器(1)


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')


相关内容