茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1729418 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_0218.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2012/11/29 5:06:42
postfix基本配置和設定DNS

使用postfix發送郵件,需要你對本身配置做些修正,另外,也需要你設置相應的DNS,否則發送郵件會容易當做垃圾郵件。

我們做幾個步驟來看看收信的影響:

1 安裝後不設置
2 設置hostname和domain
3 設置MX記錄
4 設置SPF

以下說明的信息為了去除隱私信息,做過一些名稱修改:

= 1 沒有任何配置 =
Delivered-To: your-email@gmail.com
Received: by 10.114.181.20 with SMTP id d20cs1238waf;
        Mon, 4 Jan 2010 17:33:21 -0800 (PST)
Received: by 10.141.90.17 with SMTP id s17mr7576023rvl.196.1262655201126;
        Mon, 04 Jan 2010 17:33:21 -0800 (PST)
Return-Path:
Received: from localhost.localdomain ([219.232.1.2])
        by mx.google.com with ESMTP id 20si58728702pwj.8.2010.01.04.17.33.18;
        Mon, 04 Jan 2010 17:33:19 -0800 (PST)
Received-SPF: neutral (google.com: 219.232.1.2 is neither permitted nor denied by best guess record for domain of root@localhost.localdomain) client-ip=219.232.1.2;
Authentication-Results: mx.google.com; spf=neutral (google.com: 219.232.1.2 is neither permitted nor denied by best guess record for domain of root@localhost.localdomain) smtp.mail=root@localhost.localdomain
Received: by localhost.localdomain (Postfix, from userid 0)
  id 7BF5120DF2C; Mon,  4 Jan 2010 21:33:09 -0500 (EST)
To: your-email@gmail.com
Subject: test in 95
Message-Id: <20100105023309.7BF5120DF2C@localhost.localdomain>
Date: Mon,  4 Jan 2010 21:33:09 -0500 (EST)
From: root@localhost.localdomain (root)

test


我們看到,發信人是root@localhost.localdomain,明顯不對的
回復郵件也肯定收不到,我們至少需要用戶能夠回復,當然,除非你不想。

= 2 設置hostname和domain =
postconf -e "myhostname=aslibra.com"
postconf -e "mydomain=mail.aslibra.com"
postfix reload


postfix裡面修改參數可以用以上的方式,檢查參數
可以是 postconf myhostname
Delivered-To: your-email@gmail.com
Received: by 10.114.181.20 with SMTP id d20cs2044waf;
        Mon, 4 Jan 2010 17:52:44 -0800 (PST)
Received: by 10.142.2.14 with SMTP id 14mr7796472wfb.93.1262656364099;
        Mon, 04 Jan 2010 17:52:44 -0800 (PST)
Return-Path:
Received: from aslibra.com ([219.232.1.2])
        by mx.google.com with ESMTP id 4si15052142pwj.24.2010.01.04.17.52.43;
        Mon, 04 Jan 2010 17:52:43 -0800 (PST)
Received-SPF: neutral (google.com: 219.232.1.2 is neither permitted nor denied by best guess record for domain of root@aslibra.com) client-ip=219.232.1.2;
Authentication-Results: mx.google.com; spf=neutral (google.com: 219.232.1.2 is neither permitted nor denied by best guess record for domain of root@aslibra.com) smtp.mail=root@aslibra.com
Received: by aslibra.com (Postfix, from userid 0)
  id 9AB3420DF2F; Mon,  4 Jan 2010 21:52:34 -0500 (EST)
To: your-email@gmail.com
Subject: test after modify myhostname and mydomain
Message-Id: <20100105025234.9AB3420DF2F@aslibra.com>
Date: Mon,  4 Jan 2010 21:52:34 -0500 (EST)
From: root@aslibra.com (root)

test


看到了吧?
發信人是 root@aslibra.com 了,這用戶至少知道是誰發的
如果用戶回復郵件,那就會發到aslibra.com指定的郵件服務器,這個是通過DNS查詢判斷發送到哪裡的。
下面來修改DNS:

= 3 設置DNS =

添加一條MX記錄:@ MX mail.aslibra.com.
再添加一條A記錄: mail A your_IP
一般建議不直接指向IP

收到的郵件無變化,忽略郵件說明。

= 4 設置SPF =

細心的話,可以看的出來,gmail有一段信息:
Received-SPF: neutral (google.com: 219.232.1.2 is neither permitted nor denied by best guess record for domain of root@aslibra.com) client-ip=219.232.1.2;
Authentication-Results: mx.google.com; spf=neutral (google.com: 219.232.1.2 is neither permitted nor denied by best guess record for domain of root@aslibra.com) smtp.mail=root@aslibra.com


SPF是什麼?


SPF 是發送方策略框架
  (Sender Policy Framework) 的縮寫,一種以IP(互聯網協定)地址認證電子郵件寄件人身份的技術,是非常高效的垃圾郵件解決方案,旨在應對垃圾郵件中的一個特別問題——發送方假冒問題。當用戶定義了他的域名SPF記錄之後,接收郵件方會根據該用戶的SPF記錄來確定連接過來的IP地址是否被包含在SPF記錄裡面,如果在,則認為是一封正確的郵件,否則則認為是一封偽造的郵件。因此,那些發信人偽造域名的垃圾郵件在SPF的火眼金睛下再也無法隱藏,企業郵箱就可以有效地避免此類垃圾郵件。


設置SPF可以有簡單的方法:
http://old.openspf.org/wizard.html

DNS添加一條TXT記錄:
v=spf1 mx a:mail.aslibra.com ~all


郵件會不一樣:
Delivered-To: your-email@gmail.com
Received: by 10.114.181.20 with SMTP id d20cs2325waf;
        Mon, 4 Jan 2010 17:58:31 -0800 (PST)
Received: by 10.141.100.8 with SMTP id c8mr13115112rvm.201.1262656711500;
        Mon, 04 Jan 2010 17:58:31 -0800 (PST)
Return-Path:
Received: from aslibra.com ([219.232.1.2])
        by mx.google.com with ESMTP id 35si27159111pxi.23.2010.01.04.17.58.30;
        Mon, 04 Jan 2010 17:58:30 -0800 (PST)
Received-SPF: pass (google.com: domain of root@aslibra.com designates 219.232.1.2 as permitted sender) client-ip=219.232.1.2;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of root@aslibra.com designates 219.232.1.2 as permitted sender) smtp.mail=root@aslibra.com
Received: by aslibra.com (Postfix, from userid 0)
  id 8C66C20DF2F; Mon,  4 Jan 2010 21:58:21 -0500 (EST)
To: your-email@gmail.com
Subject: test after setting SPF
Message-Id: <20100105025821.8C66C20DF2F@aslibra.com>
Date: Mon,  4 Jan 2010 21:58:21 -0500 (EST)
From: root@aslibra.com (root)

test


也就是通過了SPF檢查,這樣一般的郵件服務器都不會認為你的是垃圾郵件,除非很多人舉報你。
當然,能夠設置PTR記錄就更加完美了。



原文出處:postfix基本配置和设定DNS - 阿权的书房
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|