User Tools

Site Tools


ubuntuserver810:postfix_vs_dovecot

This is an old revision of the document!


Статья о интеграции dovecot и dspam

Добавим учетные записи для работы с виртуальными почтовыми ящиками

groupadd -g 500 vmail
useradd -g vmail -u 500 vmail
mkdir /var/vmail
chown vmail.vmail /var/vmail

Устанавливаем postfix

apt-get update
apt-get install postfix postfix-ldap

Запустить конфигуратор дебиана

dpkg-reconfigure postfix

При установке пакетов отвечаем на вопросы конфигуратора

  • Общий тип почтовой настройки - Интернет сайт
  • Системной почтовое имя - daemon.drivesource.ru

Добавляем в основной файл конфигурации /etc/postfix/main.cf

mailbox_transport = dovecot

В конфигурацию транспорта /etc/postfix/master.cf

dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}

Устанавливаем dovecot

apt-get update
apt-get install dovecot-common dovecot-imapd

Отредактируем основной файл конфигурации /etc/dovecot/dovecot.conf

# Disable LOGIN command and all other plaintext authentications unless
# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
# matches the local IP (ie. you're connecting from the same computer), the
# connection is considered secure and plaintext authentication is allowed.
disable_plaintext_auth = no
 
mail_location = maildir:/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
  }
}

Отредактируем файл /etc/dovecot/dovecot-ldap.conf для авторизации пользователей ldap

hosts = localhost
auth_bind = yes
auth_bind_userdn = uid=%u,ou=Users,dc=drivesource,dc=ru
ldap_version = 3
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))
 
# 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
ubuntuserver810/postfix_vs_dovecot.1229354054.txt.gz · Last modified: (external edit)