|
|
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已! |
|
恭喜您是本站第 1729362
位訪客!
登入 | 註冊
|
|
|
|
發表者 |
討論內容 |
冷日 (冷日) |
發表時間:2012/11/29 5:06 |
- Webmaster

- 註冊日: 2008/2/19
- 來自:
- 發表數: 15771
|
- [轉貼]postfix基本配置和設定DNS
- 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 - 阿权的书房
|
|
討論串
-
[轉貼]建置 POSTFIX 伺服器 (冷日 (冷日), 2009/3/24 6:20)
-
[轉貼]建置 POSTFIX 伺服器(壹~叁章) (冷日 (冷日), 2009/3/24 6:27)
-
[轉貼]建置 POSTFIX 伺服器(肆~陸章) (冷日 (冷日), 2009/3/24 6:30)
-
[轉貼]建置 POSTFIX 伺服器(柒~玖章) (冷日 (冷日), 2009/3/24 6:32)
-
[轉貼]建置 POSTFIX 伺服器(拾章) (冷日 (冷日), 2009/3/24 6:34)
-
[轉貼]Postfix + Amavisd-new + SpamAssassin + ClamAV (冷日 (冷日), 2009/3/25 8:29)
-
[轉貼]Postfix + Amavisd-new + SpamAssassin + ClamAV (冷日 (冷日), 2009/3/25 8:47)
-
[轉貼]Postfix的配置文件和主要命令 (冷日 (冷日), 2012/11/29 5:03)
- »
[轉貼]postfix基本配置和設定DNS (冷日 (冷日), 2012/11/29 5:06)
-
[轉貼]Postfix設定檔中文說明 (冷日 (冷日), 2012/11/29 5:09)
-
[轉貼]CentOS 6.3 Mail Server 設定筆記 (冷日 (冷日), 2014/8/13 4:32)
-
[轉貼]centos 6.5 mail server note (冷日 (冷日), 2014/8/13 4:49)
-
[分享]CentOS 使用 Samba 之 Postfix 移機紀錄 (冷日 (冷日), 2014/8/22 14:02)
|