sendmail簡介與安裝
首頁

Sendmail Related Topics
 

sendmail簡介

bullet

sendmail是UNIX系統中Default(非唯一)的SMTP Server程式。

bullet

sendmail可以擔任SMTP Server、SMTP Client、Mail Router等角色。

bullet

sendmail無法擔任Final Delivery Agent,將信件直接送入使用者信箱中。

sendmail版本與安裝
bullet

sendmail的版本 (We will use the newest version in class)

  1. sendmai網站:http://www.sendmail.org

  2. Provide Anti-Spam Configuration Capability Since Version 8.9.x

  3. RedHAT Linux 7.2光碟包含的sendmail版本為8.11.6

  4. sendmail目前(01/2002)最新版本為8.12.2(正式版本)

  5. sendmail 8.12.2新增功能(錄自http://www.sendmail.org/current-release.html)
    bullet

    Don't complain too much if stdin, stdout, or stderr are missing
    at startup, only log an error message.

    bullet

    Fix potential problem if an unknown operation mode (character
    following -b) has been specified.

    bullet

    Prevent purgestat from looping even if someone changes the
    permissions or owner of hoststatus files.

    bullet

    Properly record dropped connections in persistent host status.

    bullet

    Remove newlines from recipients read via sendmail -t to prevent
    SMTP protocol errors when sending the RCPT command.

    bullet

    Only log milter body replacements once instead of for each body
    chunk sent by a filter.

    bullet

    In 8.12.0 and 8.12.1, the headers were mistakenly not included in
    the message size calculation.

    bullet

    Since 8.12 no longer forks at the SMTP MAIL command, the daemon
    needs to collect children status to avoid zombie processes.

    bullet

    Shut down "nullserver" and ETRN-only connections after 25 bad
    commands are issued. This makes it consistent with normal
    SMTP connections.

    bullet

    Avoid duplicate logging of milter rejections.

    bullet

    Error and delay DSNs were being sent to postmaster instead of the
    message sender if the sender had used a deprecated RFC822
    source route.

    bullet

    Fix FallbackMXhost behavior for temporary errors during address
    parsing.

    bullet

    For systems on which stat(2) does not return a value for st_blksize
    that is the "optimal blocksize for I/O" three new compile
    time flags are available: SM_IO_MAX_BUF_FILE, SM_IO_MIN_BUF,
    and SM_IO_MAX_BUF, which define an upper limit for
    regular files, and a lower and upper limit for other file
    types, respectively.

    bullet

    Fix a potential deadlock if two events are supposed to occur at
    exactly the same time.

    bullet

    Perform envelope splitting for aliases listed directly in the
    alias file, not just for include/.forward files.

    bullet

    Allow selection of queue group for mailq using -qGgroup.

    bullet

    Make sure cached LDAP connections used my multiple maps in the same
    process are closed.

    bullet

    If running as root, allow reading of class files in protected
    directories.

    bullet

    Correct a few LDAP related memory leaks.

    bullet

    Allow specification of an empty realm via the authinfo ruleset.
    This is necessary to interoperate as an SMTP AUTH client
    with servers that do not support realms when using
    CRAM-MD5.

    bullet

    Avoid a potential information leak if AUTH PLAIN is used and the
    server gets stuck while processing that command.

    bullet

    In addition to printing errors when parsing recipients during
    command line invocations log them to make it simpler
    to understand possible DSNs to postmaster.

    bullet

    Do not use FallbackMXhost on mailers which have the F=0 flag set.
    Allow local mailers (F=l) to specify a host for TCP connections
    instead of forcing localhost.

    bullet

    Obey ${DESTDIR} for installation of the client mail queue and
    submit.cf.

    bullet

    Re-enable support for -M option which was broken in 8.12.1.

    bullet

    If a remote server violates the SMTP standard by unexpectedly
    dropping the connection during an SMTP transaction, stop
    sending commands. This prevents bogus "Bad file number"
    recipient status.

    bullet

    Do not use a size estimate of 100 for postmaster bounces, it's
    almost always too small; do not guess the size at all.

    bullet

    Fix DaemonPortOptions IPv6 address parsing such that ::1 works
    properly. Problem noted by Valdis Kletnieks of Virginia
    Tech.

  6. Always Use The Newest version 

bullet

 sendmail安裝  : RedHAT's Way  - With RPM

  1. sendmail related rpm Packages in CDROM 

    sendmail-8.11.6-15.i386.rpm sendmail 相關程式及檔案
    sendmail-cf-8.11.6-10.i386.rpm sendmail,cf 相關m4設定檔,You Need This Only  When You want to change /etc/sendmail.cf by m4 marcro
    sendmail-doc-8.11.6-15.i386.rpm  sendmail related Documents(Will Be installed on  /usr/doc/sendmail)

 

  1. 安裝rpm 優點在於快速、管理方便,缺點在於版本更新速度往往必須等新版sendmail被包裝成rpm後,才可以進行更版。

bullet

sendmail安裝 : UNIX's Way - make with source
以下以sendmail.8.12.2為例說明如何在RedHat中安裝新版的sendmail

Step1. Get sendmail.8.12.2 Source (sendmail.8.12.2.tar.gz)
        You can get the newest version of sendmail from www.sendmail.org, or You get it From nmc.
         Put the compressed source file in some directory.

Step2. unzip sendmail
        [root@nmc /src]# tar zxvf sendmail.8.12.2.tar.gz
   
    ### directory sendmail.8.12.2 will be created

Step 3.Build sendmai binary code
        [root@nmc /src]# cd sendmail-8.12.2/
        [root@nmc sendmail-8.12.2]# sh Build
        
Step 4. Build The Configuration File - sendmail.cf
        --cp  generic-linux.mc in sendmail-8.12.2/cf/cf  to config.mc and modify it.
        --You May refer to Sendmail Configuration and Sendmail Feature 
        --in Woody's Linux Web for how to modify config.mc
        [root@nmc cf]# pwd
        /src/sendmail-8.12.2/cf/cf
        [root@nmc cf]# cp generic-linux.mc sendmail.mc
        [root@nmc cf]# vi sendmail.mc
        ...
       DOMAIN(generic)dnl
      
## Add The Following line into linux.mc
       FEATURE(access_db,hash -T<TMPF>  /etc/mail/access) dnl 
       MAILER(local)dnl
        ...
       [root@nmc cf]# ./Build sendmail.cf
       ### sendmail.cf will be created in sendmail-8.12.2/cf/cf

Step 5. Backup Original sendmail binary adn sendmail.cf
      [root@nmc cf]# cp /usr/sbin/sendmail /usr/sbin/sendmail.8.11.6
      [root@nmc cf]# cp /etc/sendmail.cf /etc/sendmail.cf.8.11.6

Step 6. Install sendmail binary and sendmail.cf
      [root@nmc sendmail-8.12.2]# pwd
        /src/sendmail-8.12.2
      [root@nmc sendmail-8.12.2]# sh Build install
     
[root@nmc sendmail-8.12.2]# cp obj.Linux.2.4.3.i686/sendmail/sendmail  /usr/sbin
      [root@nmc cf]# cp cf/cf/sendmail.cf /etc/mail/sendmail.cf
     
###sendmail 8.12.2 use /etc/mail/sendmail.cf while sendmail 8.11.6 use /etc/sendmail.cf
      [root@nmc cf]# cp /etc/aliases /etc/mail
     
[root@nmc cf]# newaliases 
### Rebuild the alias table
        ### local-host-names define the hostnames your sendmail daemon accept !!

Step 6. Restart sendmail and Version test
       [root@nmc cf]# service sendmail restart
     
Shutting down sendmail: [ OK ]
     
Starting sendmail: [ OK ]
     
[root@nmc cf]# telnet localhost 25
     
Trying 127.0.0.1...
        Connected to localhost.
        Escape character is '^]'.
        220 nmc.nchu.edu.tw ESMTP Sendmail 8.12.2/8.12.2; Fri, 14 Jan 2002 15:56:32 +0800
       ###The Version is Now 8.12.2