特殊:Badtitle/NS100:Postfix/SPF:修订间差异
小 New page: {{From|https://help.ubuntu.com/community/Postfix/SPF}} {{Languages|php5}} == Introduction == This guide explains how to install and integrate [http://www.openspf.org/ Sender Policy Fram... |
小无编辑摘要 |
||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/Postfix/SPF}} | {{From|https://help.ubuntu.com/community/Postfix/SPF}} | ||
{{Languages| | {{Languages|UbuntuHelp:Postfix/SPF}} | ||
第80行: | 第80行: | ||
---- | ---- | ||
CategoryDocumentation | [[category:CategoryDocumentation]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年5月14日 (一) 12:03的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Postfix/SPF }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/af | • {{#if: UbuntuHelp:Postfix/SPF|Afrikaans| [[::Postfix/SPF/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/ar | • {{#if: UbuntuHelp:Postfix/SPF|العربية| [[::Postfix/SPF/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/az | • {{#if: UbuntuHelp:Postfix/SPF|azərbaycanca| [[::Postfix/SPF/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/bcc | • {{#if: UbuntuHelp:Postfix/SPF|جهلسری بلوچی| [[::Postfix/SPF/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/bg | • {{#if: UbuntuHelp:Postfix/SPF|български| [[::Postfix/SPF/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/br | • {{#if: UbuntuHelp:Postfix/SPF|brezhoneg| [[::Postfix/SPF/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/ca | • {{#if: UbuntuHelp:Postfix/SPF|català| [[::Postfix/SPF/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/cs | • {{#if: UbuntuHelp:Postfix/SPF|čeština| [[::Postfix/SPF/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/de | • {{#if: UbuntuHelp:Postfix/SPF|Deutsch| [[::Postfix/SPF/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/el | • {{#if: UbuntuHelp:Postfix/SPF|Ελληνικά| [[::Postfix/SPF/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/es | • {{#if: UbuntuHelp:Postfix/SPF|español| [[::Postfix/SPF/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/fa | • {{#if: UbuntuHelp:Postfix/SPF|فارسی| [[::Postfix/SPF/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/fi | • {{#if: UbuntuHelp:Postfix/SPF|suomi| [[::Postfix/SPF/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/fr | • {{#if: UbuntuHelp:Postfix/SPF|français| [[::Postfix/SPF/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/gu | • {{#if: UbuntuHelp:Postfix/SPF|ગુજરાતી| [[::Postfix/SPF/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/he | • {{#if: UbuntuHelp:Postfix/SPF|עברית| [[::Postfix/SPF/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/hu | • {{#if: UbuntuHelp:Postfix/SPF|magyar| [[::Postfix/SPF/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/id | • {{#if: UbuntuHelp:Postfix/SPF|Bahasa Indonesia| [[::Postfix/SPF/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/it | • {{#if: UbuntuHelp:Postfix/SPF|italiano| [[::Postfix/SPF/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/ja | • {{#if: UbuntuHelp:Postfix/SPF|日本語| [[::Postfix/SPF/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/ko | • {{#if: UbuntuHelp:Postfix/SPF|한국어| [[::Postfix/SPF/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/ksh | • {{#if: UbuntuHelp:Postfix/SPF|Ripoarisch| [[::Postfix/SPF/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/mr | • {{#if: UbuntuHelp:Postfix/SPF|मराठी| [[::Postfix/SPF/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/ms | • {{#if: UbuntuHelp:Postfix/SPF|Bahasa Melayu| [[::Postfix/SPF/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/nl | • {{#if: UbuntuHelp:Postfix/SPF|Nederlands| [[::Postfix/SPF/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/no | • {{#if: UbuntuHelp:Postfix/SPF|norsk| [[::Postfix/SPF/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/oc | • {{#if: UbuntuHelp:Postfix/SPF|occitan| [[::Postfix/SPF/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/pl | • {{#if: UbuntuHelp:Postfix/SPF|polski| [[::Postfix/SPF/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/pt | • {{#if: UbuntuHelp:Postfix/SPF|português| [[::Postfix/SPF/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/ro | • {{#if: UbuntuHelp:Postfix/SPF|română| [[::Postfix/SPF/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/ru | • {{#if: UbuntuHelp:Postfix/SPF|русский| [[::Postfix/SPF/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/si | • {{#if: UbuntuHelp:Postfix/SPF|සිංහල| [[::Postfix/SPF/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/sq | • {{#if: UbuntuHelp:Postfix/SPF|shqip| [[::Postfix/SPF/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/sr | • {{#if: UbuntuHelp:Postfix/SPF|српски / srpski| [[::Postfix/SPF/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/sv | • {{#if: UbuntuHelp:Postfix/SPF|svenska| [[::Postfix/SPF/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/th | • {{#if: UbuntuHelp:Postfix/SPF|ไทย| [[::Postfix/SPF/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/tr | • {{#if: UbuntuHelp:Postfix/SPF|Türkçe| [[::Postfix/SPF/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/vi | • {{#if: UbuntuHelp:Postfix/SPF|Tiếng Việt| [[::Postfix/SPF/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/yue | • {{#if: UbuntuHelp:Postfix/SPF|粵語| [[::Postfix/SPF/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/zh | • {{#if: UbuntuHelp:Postfix/SPF|中文| [[::Postfix/SPF/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/zh-hans | • {{#if: UbuntuHelp:Postfix/SPF|中文(简体)| [[::Postfix/SPF/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Postfix/SPF | UbuntuHelp:Postfix/SPF | {{#if: | :}}Postfix/SPF}}/zh-hant | • {{#if: UbuntuHelp:Postfix/SPF|中文(繁體)| [[::Postfix/SPF/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Postfix/SPF|:Postfix/SPF|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Postfix/SPF/zh | | {{#ifexist: Postfix/SPF/zh | | {{#ifeq: {{#titleparts:Postfix/SPF|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Postfix/SPF|1|-1|}} | zh | | }}
Introduction
This guide explains how to install and integrate Sender Policy Framework (SPF) checking with Postfix. It applies to Ubuntu 7.04 and later releases. Previous Ubuntu releases do not have the packages necessary.
SPF is an e-mail anti-forgery technology the enables domain owners to list, in the Domain Name Service (DNS), authorized sources of mail from their domains. It enables mail receivers to reject mail that does not come from authorized sources. This guide describes the second part of the protocol, rejecting mail from unauthorized sources. It assumes you have your Postfix set up and running. Setting up and running Postfix is described elsewhere in the wiki and in the Postfix documentation.
SPF Package selection and installation
In Ubuntu 7.04 there are two RFC 4408 compliant package sets you can use. One is written in Python. The other is written in Perl. They have essentially equivalent functionality. If you are uncertain, you should review the documentation (man pages) for both. It's largely a question of which programming language you are more comfortable with.
For the Python programs, installation is:
apt-get install python-policyd-spf python-spf
For the Perl system, installation is:
apt-get install postfix-policyd-spf-perl libmail-spf-perl
Postfix Integration
There are a number of changes the need to be made to integrate SPF checking with Postfix. In this guide, integration of the Python programs is described. The Perl programs are integrated very similarly. See man postfix-policyd-spf-perl for details.
Enabling the Policy Service
In /etc/postfix/main.cf you will need to add the following line (it doesn't matter where, usually they get added to the end.
policy_time_limit = 3600s
This changed the ups the policy time limit so the policy server won't time out while a message is still being processed.
Add this section to /etc/postfix/master.cf
policy-spf unix - n n - - spawn user=nobody argv=/usr/bin/python /usr/bin/policy-spf
Finally, you need to add the policy service to your smtpd_recipient_restrictions:
smtpd_recipient_restrictions = ... permit_sasl_authenticated permit_mynetworks reject_unauth_destination check_policy_service unix:private/policyd-spf ...
Note: Put the policy server after reject_unauth_destination to prevent risk that unexpected responses from the policy server could make your system and open relay (this is recommended for all policy servers). Put the policy server after you permit local senders. You only want SPF to check inbound mail from the internet and not outbound mail from your users.
Restart Postfix
sudo /etc/init.d/postfix restart
Verifying It's Working
Check your mail logs. The Python server logs mail that is rejected or deferred due to SPF. If there is a problem with the policy server or its integration with Postix, it will be logged.
tail -f /var/log/mail.log
or
less /var/log/mail.log