特殊:Badtitle/NS100:PostfixDovecotSASL:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第12行: | 第12行: | ||
<pre><nowiki> | <pre><nowiki> | ||
socket listen { | socket listen { | ||
#master { | #master { | ||
# Master socket provides access to userdb information. It's typically | # Master socket provides access to userdb information. It's typically | ||
# used to give Dovecot's local delivery agent access to userdb so it | # used to give Dovecot's local delivery agent access to userdb so it | ||
# can find mailbox locations. | # can find mailbox locations. | ||
#path = /var/run/dovecot/auth-master | #path = /var/run/dovecot/auth-master | ||
#mode = 0600 | #mode = 0600 | ||
# Default user/group is the one who started dovecot-auth (root) | # Default user/group is the one who started dovecot-auth (root) | ||
#user = | #user = | ||
#group = | #group = | ||
#} | #} | ||
client { | client { | ||
# The client socket is generally safe to export to everyone. Typical use | # The client socket is generally safe to export to everyone. Typical use | ||
# is to export it to your SMTP server so it can do SMTP AUTH lookups | # is to export it to your SMTP server so it can do SMTP AUTH lookups | ||
# using it. | # using it. | ||
path = /var/spool/postfix/private/auth-client | path = /var/spool/postfix/private/auth-client | ||
mode = 0660 | mode = 0660 | ||
user = postfix | user = postfix | ||
group = postfix | group = postfix | ||
} | } | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
The <code><nowiki>/etc/dovecot/dovecot.conf</nowiki></code> file on Ubuntu 6.06 (Dapper) is slightly different: | The <code><nowiki>/etc/dovecot/dovecot.conf</nowiki></code> file on Ubuntu 6.06 (Dapper) is slightly different: | ||
<pre><nowiki> | <pre><nowiki> | ||
auth default_with_listener { | auth default_with_listener { | ||
mechanisms = plain login | mechanisms = plain login | ||
passdb pam { | passdb pam { | ||
} | } | ||
userdb passwd { | userdb passwd { | ||
} | } | ||
socket listen { | socket listen { | ||
# master { | # master { | ||
#path = /var/run/dovecot-auth-master | #path = /var/run/dovecot-auth-master | ||
# WARNING: Giving untrusted users access to master socket may be a | # WARNING: Giving untrusted users access to master socket may be a | ||
# security risk, don't give too wide permissions to it! | # security risk, don't give too wide permissions to it! | ||
#mode = 0600 | #mode = 0600 | ||
# Default user/group is the one who started dovecot-auth (root) | # Default user/group is the one who started dovecot-auth (root) | ||
#user = | #user = | ||
#group = | #group = | ||
# } | # } | ||
client { | client { | ||
path = /var/spool/postfix/private/auth-client | path = /var/spool/postfix/private/auth-client | ||
mode = 0660 | mode = 0660 | ||
user = postfix | user = postfix | ||
group = postfix | group = postfix | ||
} | } | ||
} | } | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> |
2007年12月6日 (四) 10:50的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/PostfixDovecotSASL }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/af | • {{#if: UbuntuHelp:PostfixDovecotSASL|Afrikaans| [[::PostfixDovecotSASL/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/ar | • {{#if: UbuntuHelp:PostfixDovecotSASL|العربية| [[::PostfixDovecotSASL/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/az | • {{#if: UbuntuHelp:PostfixDovecotSASL|azərbaycanca| [[::PostfixDovecotSASL/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/bcc | • {{#if: UbuntuHelp:PostfixDovecotSASL|جهلسری بلوچی| [[::PostfixDovecotSASL/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/bg | • {{#if: UbuntuHelp:PostfixDovecotSASL|български| [[::PostfixDovecotSASL/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/br | • {{#if: UbuntuHelp:PostfixDovecotSASL|brezhoneg| [[::PostfixDovecotSASL/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/ca | • {{#if: UbuntuHelp:PostfixDovecotSASL|català| [[::PostfixDovecotSASL/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/cs | • {{#if: UbuntuHelp:PostfixDovecotSASL|čeština| [[::PostfixDovecotSASL/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/de | • {{#if: UbuntuHelp:PostfixDovecotSASL|Deutsch| [[::PostfixDovecotSASL/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/el | • {{#if: UbuntuHelp:PostfixDovecotSASL|Ελληνικά| [[::PostfixDovecotSASL/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/es | • {{#if: UbuntuHelp:PostfixDovecotSASL|español| [[::PostfixDovecotSASL/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/fa | • {{#if: UbuntuHelp:PostfixDovecotSASL|فارسی| [[::PostfixDovecotSASL/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/fi | • {{#if: UbuntuHelp:PostfixDovecotSASL|suomi| [[::PostfixDovecotSASL/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/fr | • {{#if: UbuntuHelp:PostfixDovecotSASL|français| [[::PostfixDovecotSASL/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/gu | • {{#if: UbuntuHelp:PostfixDovecotSASL|ગુજરાતી| [[::PostfixDovecotSASL/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/he | • {{#if: UbuntuHelp:PostfixDovecotSASL|עברית| [[::PostfixDovecotSASL/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/hu | • {{#if: UbuntuHelp:PostfixDovecotSASL|magyar| [[::PostfixDovecotSASL/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/id | • {{#if: UbuntuHelp:PostfixDovecotSASL|Bahasa Indonesia| [[::PostfixDovecotSASL/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/it | • {{#if: UbuntuHelp:PostfixDovecotSASL|italiano| [[::PostfixDovecotSASL/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/ja | • {{#if: UbuntuHelp:PostfixDovecotSASL|日本語| [[::PostfixDovecotSASL/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/ko | • {{#if: UbuntuHelp:PostfixDovecotSASL|한국어| [[::PostfixDovecotSASL/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/ksh | • {{#if: UbuntuHelp:PostfixDovecotSASL|Ripoarisch| [[::PostfixDovecotSASL/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/mr | • {{#if: UbuntuHelp:PostfixDovecotSASL|मराठी| [[::PostfixDovecotSASL/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/ms | • {{#if: UbuntuHelp:PostfixDovecotSASL|Bahasa Melayu| [[::PostfixDovecotSASL/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/nl | • {{#if: UbuntuHelp:PostfixDovecotSASL|Nederlands| [[::PostfixDovecotSASL/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/no | • {{#if: UbuntuHelp:PostfixDovecotSASL|norsk| [[::PostfixDovecotSASL/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/oc | • {{#if: UbuntuHelp:PostfixDovecotSASL|occitan| [[::PostfixDovecotSASL/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/pl | • {{#if: UbuntuHelp:PostfixDovecotSASL|polski| [[::PostfixDovecotSASL/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/pt | • {{#if: UbuntuHelp:PostfixDovecotSASL|português| [[::PostfixDovecotSASL/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/ro | • {{#if: UbuntuHelp:PostfixDovecotSASL|română| [[::PostfixDovecotSASL/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/ru | • {{#if: UbuntuHelp:PostfixDovecotSASL|русский| [[::PostfixDovecotSASL/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/si | • {{#if: UbuntuHelp:PostfixDovecotSASL|සිංහල| [[::PostfixDovecotSASL/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/sq | • {{#if: UbuntuHelp:PostfixDovecotSASL|shqip| [[::PostfixDovecotSASL/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/sr | • {{#if: UbuntuHelp:PostfixDovecotSASL|српски / srpski| [[::PostfixDovecotSASL/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/sv | • {{#if: UbuntuHelp:PostfixDovecotSASL|svenska| [[::PostfixDovecotSASL/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/th | • {{#if: UbuntuHelp:PostfixDovecotSASL|ไทย| [[::PostfixDovecotSASL/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/tr | • {{#if: UbuntuHelp:PostfixDovecotSASL|Türkçe| [[::PostfixDovecotSASL/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/vi | • {{#if: UbuntuHelp:PostfixDovecotSASL|Tiếng Việt| [[::PostfixDovecotSASL/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/yue | • {{#if: UbuntuHelp:PostfixDovecotSASL|粵語| [[::PostfixDovecotSASL/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/zh | • {{#if: UbuntuHelp:PostfixDovecotSASL|中文| [[::PostfixDovecotSASL/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/zh-hans | • {{#if: UbuntuHelp:PostfixDovecotSASL|中文(简体)| [[::PostfixDovecotSASL/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PostfixDovecotSASL | UbuntuHelp:PostfixDovecotSASL | {{#if: | :}}PostfixDovecotSASL}}/zh-hant | • {{#if: UbuntuHelp:PostfixDovecotSASL|中文(繁體)| [[::PostfixDovecotSASL/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:PostfixDovecotSASL|:PostfixDovecotSASL|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :PostfixDovecotSASL/zh | | {{#ifexist: PostfixDovecotSASL/zh | | {{#ifeq: {{#titleparts:PostfixDovecotSASL|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:PostfixDovecotSASL|1|-1|}} | zh | | }}
Introduction
This guide will guide you through the steps needed to enable Postfix to use the SASL implementation provided by Dovecot. This is an alternative to configuring Postfix to use the Cyrus SASL implementation.
Installation
Everything you need to configure Postfix to use Dovecot SASL is included when you install the dovecot-common and postfix packages from the Main repository. You will probably also want to install dovecot-imapd or dovecot-pop3d which provide IMAP and POP3 services. See the Dovecot guide for more information on setting up Dovecot.
Configuration
Dovecot
First let's configure Dovecot to provide SASL client authentication. To accomplish this edit the Dovecot configuration file /etc/dovecot/dovecot.conf
If you're using Ubuntu 7.10 (Gutsy) your configuration should look like this:
socket listen { #master { # Master socket provides access to userdb information. It's typically # used to give Dovecot's local delivery agent access to userdb so it # can find mailbox locations. #path = /var/run/dovecot/auth-master #mode = 0600 # Default user/group is the one who started dovecot-auth (root) #user = #group = #} client { # The client socket is generally safe to export to everyone. Typical use # is to export it to your SMTP server so it can do SMTP AUTH lookups # using it. path = /var/spool/postfix/private/auth-client mode = 0660 user = postfix group = postfix } }
The /etc/dovecot/dovecot.conf
file on Ubuntu 6.06 (Dapper) is slightly different:
auth default_with_listener { mechanisms = plain login passdb pam { } userdb passwd { } socket listen { # master { #path = /var/run/dovecot-auth-master # WARNING: Giving untrusted users access to master socket may be a # security risk, don't give too wide permissions to it! #mode = 0600 # Default user/group is the one who started dovecot-auth (root) #user = #group = # } client { path = /var/spool/postfix/private/auth-client mode = 0660 user = postfix group = postfix } } }
Once you've configured Dovecot to provide SASL you'll need to restart it:
sudo /etc/init.d/dovecot restart
Postfix
After you've configured Dovecot to provide SASL authentication it's time to configure Postfix to use it.
First edit the /etc/postfix/main.cf
configuration file. You can do this with a text editor or by using the postconf -e command:
sudo postconf -e 'smtpd_sasl_type = dovecot' sudo postconf -e 'smtpd_sasl_path = private/auth-client' sudo postconf -e 'smtpd_sasl_auth_enable = yes' sudo postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'
Note: the smtpd_sasl_path configuration needs to be a path relative to the Postfix queue directory. Now restart Postfix to enable the new configurations:
sudo /etc/init.d/postfix restart
Testing
To see if Dovecot SASL is working properly run the following command: telnet localhost 25 After you have established the connection to your postfix mail server type ehlo localhost If you see the lines
250-AUTH PLAIN LOGIN
among others, everything is working.
Type quit to return to the system's shell.
Note: this guide has been tested on Ubuntu 6.06 (Dapper Drake) and Ubuntu 7.10 (Gutsy Gibbon).