天天看點

sendmail外發郵件

sendmail預設設定發sina,hotmail這樣的郵箱是會被拒收的.要做一下幾個步驟

1.修改伺服器主機名為 noreply.yourdomain.com

  1.1 hostname noreply.yourdomain.com

  1.2 vim /etc/sysconfig/network

  1.3 vim /etc/hosts

2. dns中添加mx記錄noreply.yourdomain.com

   2.1 公司的郵件伺服器還在用,是以mx 記錄要比現存的優先級低.

   2.2 noreply.yourdomain.com 的a記錄

   2.3 修改域名的txt記錄, 形式如 v=spf1 mx a:ex1.yourdomain.com a:noreply.yourdomain.com ip4:115.238.xxx.xxx ~all

3. 修改sendmail的配置檔案

   3.1 vim /etc/mail/access 添加一行 connect:noreply.yourdomain.com       relay

   3.2 vim /etc/mail/local-host-names 添加 yourdomain.com

   3.3 vim /etc/mail/sendmail.cf 中找到cwlocalhost 修改為 cwlocalhost  noreply.yourdomain.com

   3.4 重新開機sendmail