User Tools

Site Tools


ubuntuserver810:postfix_vs_dovecot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntuserver810:postfix_vs_dovecot [2008/12/15 14:18] svschwartzubuntuserver810:postfix_vs_dovecot [2010/06/20 16:19] (current) svschwartz
Line 1: Line 1:
- 
-[[http://johannes.sipsolutions.net/Projects/dovecot-antispam | Статья о интеграции dovecot и dspam]] 
- 
- 
 Добавим учетные записи для работы с виртуальными почтовыми ящиками Добавим учетные записи для работы с виртуальными почтовыми ящиками
 <code> <code>
-groupadd -r -g 500 vmail +groupadd -g 500 vmail 
-useradd -r -g vmail -u 500 vmail+useradd -g vmail -u 500 vmail
 mkdir /var/vmail mkdir /var/vmail
 chown vmail.vmail /var/vmail chown vmail.vmail /var/vmail
Line 25: Line 21:
   * Общий тип почтовой настройки - Интернет сайт   * Общий тип почтовой настройки - Интернет сайт
   * Системной почтовое имя - daemon.drivesource.ru   * Системной почтовое имя - daemon.drivesource.ru
 +
 +Добавляем в основной файл конфигурации **/etc/postfix/main.cf**
 +<code>
 +# basic protection
 +smtpd_helo_required = yes
 +strict_rfc821_envelopes = yes
 +smtpd_helo_restrictions =
 +        permit_mynetworks
 +        reject_invalid_helo_hostname
 +        reject_non_fqdn_helo_hostname
 +        reject_unknown_hostname
 +
 +smtpd_recipient_restrictions =
 +        permit_mynetworks
 +        permit_sasl_authenticated
 +        reject_unauth_destination
 +
 +virtual_mailbox_domains = drivesource.ru
 +virtual_alias_maps = hash:/etc/postfix/virtual_alias
 +virtual_mailbox_maps = ldap:/etc/postfix/ldap-aliases.cf
 +virtual_transport = dovecot
 +dovecot_destination_recipient_limit = 1
 +
 +# SASL authentication
 +smtpd_sasl_auth_enable = yes
 +smtpd_sasl_type = dovecot
 +smtpd_sasl_path = private/auth
 +
 +</code>
 +
 +Запишем в файл ** /etc/postfix/ldap-aliases.cf ** следующую конфигурацию
 +<code>
 +server_host = localhost
 +search_base = ou=Users,dc=drivesource, dc=ru
 +query_filter = uid=%u
 +result_attribute = uid
 +</code>
 +
 +В конфигурацию транспорта **/etc/postfix/master.cf**
 +<code>
 +dovecot   unix  -                               pipe
 +  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}
 +</code>
  
 Устанавливаем [[http://www.dovecot.org/|dovecot]] Устанавливаем [[http://www.dovecot.org/|dovecot]]
Line 42: Line 81:
 mail_location = maildir:/var/vmail/%u mail_location = maildir:/var/vmail/%u
  
-# в секции auth default +System user and group used to access mails. If you use multiple, userdb 
-  passdb ldap { +# can override these by returning uid or gid fields. You can use either numbers 
-    args = /etc/dovecot/dovecot-ldap.conf +# or names. <doc/wiki/UserIds> 
-  } +mail_uid = 500 
-  userdb static +mail_gid = 500 
-    args = uid=500 gid=500 home=/var/vmail/%u+ 
 + 
 + 
 +protocol lda { 
 +  sendmail_path = /usr/lib/sendmail 
 +  auth_socket_path = /var/run/dovecot/auth-master 
 +
 + 
 +# заблокировать системные учетные записи 
 +#passdb pam { 
 +#} 
 + 
 +passdb ldap { 
 +  args = /etc/dovecot/dovecot-ldap.conf 
 +
 + 
 +# заблокировать системные учетные записи 
 +#userdb passwd { 
 +#} 
 + 
 +userdb ldap { 
 +  args = /etc/dovecot/dovecot-ldap.conf 
 +} 
 + 
 +## dovecot-lda specific settings 
 +## 
 +socket listen { 
 +  master 
 +    path = /var/run/dovecot/auth-master 
 +    mode = 0600 
 +    user = vmail # User running Dovecot LDA 
 +    group = vmail # Or alternatively mode 0660 + LDA user in this 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/run/dovecot/auth-client
 +      #mode = 0660
 +      path = /var/spool/postfix/private/auth
 +      mode = 0660
 +      user = postfix
 +      group = postfix
 +    }
 +
 +}
 +
 </code> </code>
  
Line 58: Line 142:
 ldap_version = 3 ldap_version = 3
 base = ou=Users, dc=drivesource, dc=ru base = ou=Users, dc=drivesource, dc=ru
 +
 +# User attributes are given in LDAP-name=dovecot-internal-name list. The
 +# internal names are:
 +#   uid - System UID
 +#   gid - System GID
 +#   home - Home directory
 +#   mail - Mail location
 +#
 +# There are also other special fields which can be returned, see
 +# http://wiki.dovecot.org/UserDatabase/ExtraFields
 +user_attrs =
 +
 +# Filter for user lookup. Some variables can be used (see
 +# http://wiki.dovecot.org/Variables for full list):
 +#   %u - username
 +#   %n - user part in user@domain, same as %u if there's no domain
 +#   %d - domain part in user@domain, empty if user there's no domain
 user_filter = (&(objectClass=posixAccount)(uid=%u)) user_filter = (&(objectClass=posixAccount)(uid=%u))
 +
 +# You can use same UID and GID for all user accounts if you really want to.
 +# If the UID/GID is still found from LDAP reply, it overrides these values.
 +#user_global_uid = 500
 +#user_global_gid = 500
 </code> </code>
ubuntuserver810/postfix_vs_dovecot.1229350717.txt.gz · Last modified: (external edit)