顯示頁面舊版反向連結Fold/unfold all回到頁頂 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== 正式 Mail Server 所需要的必備環境條件 ====== <WRAP center round tip 60%> - 有固定對外 IP 與 Domain Name - IP 要能正反查到 Domain Name 與 IP 對應關係 - IP 不能出現在垃圾郵件黑名單內 - DNS 內的 MX 定義要正確 - Mail Server 的權限設定要正確 - Firewall 的開放設定要正確 </WRAP> <note> 以前架設 Mail Server 不須要很嚴謹的設定都可以容易上線運作, 但是近幾年來因為垃圾郵件過多, 所以相關的設定必須要符合要求, 才能在各個郵件主機間互相傳遞信件. </note> 以下是針對上述必備環境條件分項說明: ===== 1. 有固定對外 IP 與 Domain Name ===== 以 HiNet ms6 郵件主機為例, 固定 IP 為 168.95.4.60, Domain Name 為 ms6.hinet.net ===== 2. IP 要能正反查到 Domain Name 與 IP 對應關係 ===== 可以透過 DOS 底下的 nslookup 來確認, 再以 HiNet 的 ms6.hinet.net 郵件主機說明. ==== Domain Name 找 IP 正向查詢: ==== <file> C:\Documents and Settings\USER>nslookup ms6.hinet.net Server: www.ichiayi.com Address: 220.130.131.240 Non-authoritative answer: Name: ms6.hinet.net Address: 168.95.4.60 </file> ==== IP 找 Domain Name 反向查詢: ==== <file> C:\Documents and Settings\USER>nslookup 168.95.4.60 Server: www.ichiayi.com Address: 220.130.131.240 Name: ms6.hinet.net Address: 168.95.4.60 </file> 要能夠出現這樣正反解都沒問題 ===== 3. IP 不能出現在垃圾郵件黑名單內 ===== 因為垃圾郵件過多, 所以現在大部分的郵件主機都會設定參考一些免費組織所提供的垃圾郵件主機 IP 清單, 如果來源信件 IP 出現在這個清單內, 就可能直接丟掉或做其他處理(可能前面加上 spam 的訊息). 如果要確認 168.95.4.60 是否在黑名單內, 可透過 IE 直接打以下的網址 : * https://www.spamhaus.org/query/ip/168.95.4.60 * http://postmaster.nordnet.fr/?q=168.95.4.60 * <del>http://cbl.abuseat.org/lookup.cgi?ip=168.95.4.60&.submit=Lookup</del> * https://matrix.spfbl.net/en/168.95.4.60 * https://ipcheck.proofpoint.com/?ip=168.95.4.60 * https://www.spamhaus.org/query/dbl?domain=ms6.hinet.net 網頁如果列出 <file> 168.95.4.60 is not listed in the SBL 168.95.4.60 is not listed in the PBL 168.95.4.60 is not listed in the XBL </file> 與 <file> IP Address 168.95.4.60 is not currently listed in the CBL. </file> 表示沒有在黑名單內. * 其他黑名單的服務 * http://www.barracudacentral.org/lookups ===== 4. DNS 內的 MX 定義要正確 ===== 這部份如果沒有正確設定, 會造成一直收不到信件的問題. 也是使用 nslookup 來確認 <file> nslookup > set type=mx > ms6.hinet.net Server: www.ichiayi.com Address: 220.130.131.240 Non-authoritative answer: ms6.hinet.net MX preference = 0, mail exchanger = ms6a.hinet.net hinet.net nameserver = hntp3.hinet.net hinet.net nameserver = dns.hinet.net hinet.net nameserver = hntp1.hinet.net ms6a.hinet.net internet address = 168.95.5.6 dns.hinet.net internet address = 168.95.1.1 hntp1.hinet.net internet address = 168.95.192.1 hntp3.hinet.net internet address = 168.95.192.2 </file> 表示實際上寄信給 xxx@ms6.hinet.net 是寄到 ms6a.hinet.net(168.95.5.6) 這台主機, **並非 ms6.hinet.net(168.95.4.60)** ===== 5. Mail Server 的權限設定要正確 ===== 這部份就是 Mail Relay 的開放設定, 如果全開應該會在幾天內就被列入 __3. 的垃圾郵件黑名單內__. ===== 6. Firewall 的開放設定要正確 ===== 別人要能寄信過來, 就必須開放 smtp Port 25 , 可在 DOS 底下使用 telnet 來簡單測試. 以下還是用 ms6.hinet.net 來作說明: <file> telent 168.95.5.6 25 應該會出現 220 msx-sg1-6.hinet.net ESMTP Sendmail 8.8.8/8.8.8; Tue, 3 Oct 2006 18:13:43 +0800 (CST) 可以打 quit 離開 </file> 要能讓 Outlook Express 取下信件, 就要開放 pop3 Port 110 或 imap Port 143, 也是使用剛剛的方式來確認 <file> telnet 168.95.4.60 110 應該會出現 +OK POP3 [168.95.4.60] v7.64 server ready 可以打 quit 離開 </file> 如果這些基本的條件都沒問題, 再來就是看郵件記錄檔, 裡面會紀錄郵件運作的過程, 通常依照紀錄的內容應該可以判別出問題所在. ===== 7. 實際寄信給 check-auth@verifier.port25.com 驗證 ===== * 參考 - http://www.openspf.org/Tools * 透過自己的 Mail Server 寄信到 <check-auth@verifier.port25.com> 應該可以收到回信, 在信中可以看到 - SPF check: Exp. none - "iprev" check: Exp. pass - DKIM check: Exp. pass - SpamAssassin check: Exp. ham * 透過底下詳細說明, 可以判別和自己預期的設定有否落差, 再來判別哪些設定還需要修正. ===== 其他線上檢測工具 ===== * MailTester - https://www.mail-tester.com/ * Exp. 寄一封指定 EMail 信件, 直接在網頁獲取結果 (免費方案一天只能驗證三次) * MXToolBox - https://mxtoolbox.com/ * Exp. 檢查 mail.ichiayi.com - https://mxtoolbox.com/domain/mail.ichiayi.com/ <note> 實際安裝可以參考:\\ **[[tech:install_mail]]** </note> {{tag>mail 郵件}} tech/mail.txt 上一次變更: 2024/08/17 16:04由 jonathan