linux Sendmail配置简明教程(2)

  配置策略
  sendmail.cf是Sendmail的配置文件,它全权决定了Sendmail的属性。这个文件定义邮件服务器为哪个域工作。其中的内容为特定宏,大多数人对它都抱有恐惧心理,因为文件中的宏代码实在是太多。sendmail.cf通常是由一个以mc结尾的文件编译产生。如RedHat自带一个redhat.mc,用户可以自己修改其中的一些设置,使之适合自己。笔者的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 package installed for this to work.
  include(`/usr/lib/Sendmail-cf/m4/cf.m4')
  define(`confDEF_USER_ID',``8:12'')
  OSTYPE(`linux')
  undefine(`UUCP_RELAY')
  undefine(`BITNET_RELAY')
  define(`confAUTO_REBUILD')
  define(`confTO_CONNECT', `1m')
  define(`confTRY_NULL_MX_LIST',true)
  define(`confDONT_PROBE_INTERFACES',true)
  define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')
  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)
  MAILER(smtp)
  MAILER(procmail)
  FEATURE(`access_db')
  FEATURE(`blacklist_recipients')
  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.
  FEATURE(`accept_unresolvable_domains')
  dnl FEATURE(`relay_based_on_MX')

  编译sendmail.mc以产生需要的sendmail.cf文件:# m4 /etc/sendmail.mc > /etc/mail/sendmail.cf。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwwdgz.html