> Kuenhourg's 隨手記事簿: Linux基本Mail建置(SendMail)

2011年10月11日 星期二

Linux基本Mail建置(SendMail)

套件:sendmail、m4(編碼轉換)、sendmail-cf目錄:/etc/mail/
            /var/log/mail/
            /var/log/maillog
            /var/spool/mail
設定檔:/etc/mail/sendmail.mc
                拿掉127.0.0.1改為0.0.0.0 執行m4 sendmail.mc > sendmail.cf
收送信埠:MTA 送信 25 port
                    MUA Mail User Agent (dovecot服務 /etc/dovecot.conf)
                              POP3 收信 110 port
                              IMAP 收/送 143 port
                              POP3s 加密 995 port
                              IMAPs 加密 993 port
指令發送信件
        #mail -s test abc@abc.com
        xxxxx 本文
        .  <-結束
        Cc:

        EHLO localhost
        MAIL FROM: abc@abc.com
        RCPT TO: xyz@xyz.com
                          Relaying denied. IP name lookup failed.
        DATA
        Subject:hello
        .  <-離開

※Relay問題? 設定檔 /etc/mail/access 將Relay區放入即可 Ex. 140.137.215  RELAY
                        makemap -V hash access.db < access

SMTP認證:
                     #yum -y install cyrus-sasl*
                       修改 /etc/mail/sendmail.mc 第52,53行,刪除dn1字串
                     #m4 sendmail.mc > sendmail.cf
                     #service saslauthd restart
                     #service sendmail restart

郵件主機名稱:
                          1.#hostname a234.snpy.org
                          2./etcsysconfig/network 加入HOSTNAME=a234.snpy.org
                          3./etc/hosts 加入140.137.215.234 a234.snpy.org

收多網域信件: /etc/mail/local-host-name 加入domain