特殊:Badtitle/NS100:PostfixDovecotSASL:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Oneleaf留言 | 贡献
新页面: {{From|https://help.ubuntu.com/community/PostfixDovecotSASL}} {{Languages|UbuntuHelp:PostfixDovecotSASL}} == Introduction == This guide will guide you through the steps needed to enabl...
 
Wikibot留言 | 贡献
无编辑摘要
 
(未显示同一用户的6个中间版本)
第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|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) or newer version, your configuration should look like this:
If you're using Ubuntu 7.10 (Gutsy) your configuration should look like this:
 
<pre><nowiki>
<pre><nowiki>
auth default {
  mechanisms = plain login
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>
 
'''Note:''' you will need to install the '''Postfix''' version in dapper-backports in order to use Dovecot SASL on Ubuntu 6.06.  See [[UbuntuHelp:UbuntuBackports|UbuntuBackports]] for more information.
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行: 第77行:
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:UbuntuHelp]]
[[category:UbuntuHelp]]

2009年5月12日 (二) 18:27的最新版本

{{#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) or newer version, your configuration should look like this:

auth default {
  mechanisms = plain login
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
    }
  }
}

Note: you will need to install the Postfix version in dapper-backports in order to use Dovecot SASL on Ubuntu 6.06. See UbuntuBackports for more information. 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).