1. 架設 Bind (DNS) 時, 在 options { 當中, 把 listen-on 註解掉能可以傾聽所有. allow-query 註解掉, 遠端就可查詢的到.
2. sendmail.cf 設定
#file containing names of hosts for which we receive email
Fw/etc/mail/local-host-names ==> 在 local-host-name 中加入 localhost
#Hosts for which relaying is permitted ($=R)
FR-o /etc/mail/relay-domains ==> 在 relay-domains 中加入 mail server domain name
# 將IP設為0.0.0.0 , 如設定 127.0.0.1 或是 192.168.0.x , 皆會使得mail server只接受這個 ip 的遞送
O DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA
"smart" relay host 設定
交由 msa.hinet.net 代為轉送信件, 就相當於由別台郵件伺服器發信.(Realy)
DSmsa.hinet.net
定義 Mail From 的名稱 (ex: mail from: user@example.com.tw)
DMexample.com.tw
系統除 localhost外, 也由 /etc/mail/local-host-name 中尋找代收的 domain name
Fw/etc/mail/local-host-name
3. access 的設定
Connect:192.168.0 RELAY ==> 允許來自 192.168.0/24 的網段 relay
Connect:mail.sample.com.tw RELAY ==> 允許 mail server 's domain Relay
Connect:.example.com.tw RELAY ==> 允許來自 example.com.tw 的位址 Relay 結束後用
另外, 還有 DISCARD(丟棄), REJECT(拒絕), OK(無條件允許) 等設定方式; 建議採用 DISCARD, 以避免造成 sendmail 負擔!
makemap hash access.db <>
4. 讓 sendmail 可驗證大小寫帳號
搜尋 Mlocal, 添加如字串中的紅色字 F=1sDFMAw5:/|@qSPFhun9; 預設 sendmail 是忽略大寫的帳號, 因此若要讓大寫帳號可使用, 則必須添加這個 'u'
[相關 sendmail.cf 設定可參考 http://www.sendmail.org/m4/tweaking_config.html]
沒有留言:
張貼留言