个人工具

“UbuntuHelp:PostfixDovecotSASL”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/PostfixDovecotSASL}} {{Languages|UbuntuHelp:PostfixDovecotSASL}} == Introduction == This guide will guide you through the steps needed to enabl...)
 
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/PostfixDovecotSASL}}
 
{{From|https://help.ubuntu.com/community/PostfixDovecotSASL}}
 
{{Languages|UbuntuHelp:PostfixDovecotSASL}}
 
{{Languages|UbuntuHelp:PostfixDovecotSASL}}
 
 
 
== Introduction ==
 
== 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.
 
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 ==
 
== 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.
 
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 [[UbuntuHelp:Dovecot]] guide for more information on setting up Dovecot.
 
See the [[UbuntuHelp:Dovecot]] guide for more information on setting up Dovecot.
 
 
 
== Configuration ==
 
== Configuration ==
 
 
=== Dovecot ===
 
=== Dovecot ===
 
 
First let's configure '''Dovecot''' to provide SASL client authentication.  To accomplish this edit the Dovecot configuration file <code><nowiki>/etc/dovecot/dovecot.conf</nowiki></code>
 
First let's configure '''Dovecot''' to provide SASL client authentication.  To accomplish this edit the Dovecot configuration file <code><nowiki>/etc/dovecot/dovecot.conf</nowiki></code>
 
 
If you're using Ubuntu 7.10 (Gutsy) your configuration should look like this:
 
If you're using Ubuntu 7.10 (Gutsy) your configuration should look like this:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
socket listen {
 
socket listen {
第45行: 第33行:
 
}
 
}
 
</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>
第73行: 第60行:
 
}
 
}
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Once you've configured Dovecot to provide SASL you'll need to restart it:
 
Once you've configured Dovecot to provide SASL you'll need to restart it:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo /etc/init.d/dovecot restart
 
sudo /etc/init.d/dovecot restart
 
</nowiki></pre>
 
</nowiki></pre>
 
 
=== Postfix ===
 
=== Postfix ===
 
 
After you've configured Dovecot to provide SASL authentication it's time to configure Postfix to use it.
 
After you've configured Dovecot to provide SASL authentication it's time to configure Postfix to use it.
 
 
First edit the <code><nowiki>/etc/postfix/main.cf</nowiki></code> configuration file.  You can do this with a text editor or by using the '''postconf -e''' command:
 
First edit the <code><nowiki>/etc/postfix/main.cf</nowiki></code> configuration file.  You can do this with a text editor or by using the '''postconf -e''' command:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo postconf -e 'smtpd_sasl_type = dovecot'
 
sudo postconf -e 'smtpd_sasl_type = dovecot'
第92行: 第73行:
 
sudo postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'
 
sudo postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'
 
</nowiki></pre>
 
</nowiki></pre>
 
 
'''Note:''' the '''smtpd_sasl_path''' configuration needs to be a path relative to the Postfix '''queue''' directory.   
 
'''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:
 
Now restart Postfix to enable the new configurations:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo /etc/init.d/postfix restart
 
sudo /etc/init.d/postfix restart
 
</nowiki></pre>
 
</nowiki></pre>
 
 
== Testing ==
 
== Testing ==
 
 
To see if Dovecot SASL is working properly run the following command:
 
To see if Dovecot SASL is working properly run the following command:
 
 
telnet localhost 25
 
telnet localhost 25
 
 
After you have established the connection to your postfix mail server type
 
After you have established the connection to your postfix mail server type
 
 
ehlo localhost
 
ehlo localhost
 
 
If you see the lines
 
If you see the lines
 
 
<pre><nowiki>
 
<pre><nowiki>
 
250-AUTH PLAIN LOGIN
 
250-AUTH PLAIN LOGIN
 
</nowiki></pre>
 
</nowiki></pre>
 
 
among others, everything is working.
 
among others, everything is working.
 
 
Type quit to return to the system's shell.  
 
Type quit to return to the system's shell.  
 
 
<br>
 
<br>
 
 
'''Note:''' this guide has been tested on Ubuntu 6.06 (Dapper Drake) and Ubuntu 7.10 (Gutsy Gibbon).
 
'''Note:''' this guide has been tested on Ubuntu 6.06 (Dapper Drake) and Ubuntu 7.10 (Gutsy Gibbon).
 
 
----
 
----
 
[[category:CategoryDocumentation]]
 
[[category:CategoryDocumentation]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 21:06的版本

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 UbuntuHelp: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).