ubuntuserver810:postfix_vs_dovecot
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ubuntuserver810:postfix_vs_dovecot [2008/11/30 22:08] – svschwartz | ubuntuserver810:postfix_vs_dovecot [2010/06/20 16:19] (current) – svschwartz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | Добавим учетные записи для работы с виртуальными почтовыми ящиками | ||
| + | < | ||
| + | groupadd -g 500 vmail | ||
| + | useradd -g vmail -u 500 vmail | ||
| + | mkdir /var/vmail | ||
| + | chown vmail.vmail /var/vmail | ||
| + | </ | ||
| + | |||
| Устанавливаем postfix | Устанавливаем postfix | ||
| < | < | ||
| Line 14: | Line 22: | ||
| * Системной почтовое имя - daemon.drivesource.ru | * Системной почтовое имя - daemon.drivesource.ru | ||
| - | Стартовый конфиг | + | Добавляем в основной файл |
| < | < | ||
| - | # See / | + | # basic protection |
| - | # Debian specific: | + | smtpd_helo_required = yes |
| - | # line of that file to be used as the name. The Debian default | + | strict_rfc821_envelopes = yes |
| - | # is / | + | smtpd_helo_restrictions |
| - | # | + | permit_mynetworks |
| + | reject_invalid_helo_hostname | ||
| + | reject_non_fqdn_helo_hostname | ||
| + | reject_unknown_hostname | ||
| - | smtpd_banner | + | smtpd_recipient_restrictions |
| - | biff = no | + | |
| + | permit_sasl_authenticated | ||
| + | reject_unauth_destination | ||
| - | # appending | + | virtual_mailbox_domains = drivesource.ru |
| - | append_dot_mydomain | + | virtual_alias_maps = hash:/ |
| + | virtual_mailbox_maps = ldap:/ | ||
| + | virtual_transport = dovecot | ||
| + | dovecot_destination_recipient_limit | ||
| - | # Uncomment the next line to generate " | + | # SASL authentication |
| - | # | + | smtpd_sasl_auth_enable |
| + | smtpd_sasl_type = dovecot | ||
| + | smtpd_sasl_path = private/ | ||
| - | readme_directory = no | + | </ |
| - | # TLS parameters | + | Запишем в файл ** / |
| - | smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem | + | < |
| - | smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key | + | server_host |
| - | smtpd_use_tls=yes | + | search_base = ou=Users, |
| - | smtpd_tls_session_cache_database | + | query_filter = uid=%u |
| - | smtp_tls_session_cache_database | + | result_attribute = uid |
| + | </ | ||
| + | |||
| + | В конфигурацию транспорта **/etc/postfix/master.cf** | ||
| + | < | ||
| + | dovecot | ||
| + | | ||
| + | </ | ||
| + | |||
| + | Устанавливаем [[http:// | ||
| + | < | ||
| + | apt-get update | ||
| + | apt-get install dovecot-common dovecot-imapd | ||
| + | </ | ||
| + | |||
| + | Отредактируем основной файл конфигурации **/ | ||
| + | <code php> | ||
| + | # 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 | ||
| + | |||
| + | mail_location | ||
| + | |||
| + | # System user and group used to access mails. If you use multiple, userdb | ||
| + | # can override these by returning uid or gid fields. You can use either numbers | ||
| + | # or names. < | ||
| + | mail_uid = 500 | ||
| + | mail_gid = 500 | ||
| + | |||
| + | |||
| + | |||
| + | protocol lda { | ||
| + | sendmail_path = /usr/ | ||
| + | | ||
| + | } | ||
| + | |||
| + | # заблокировать системные учетные записи | ||
| + | #passdb pam { | ||
| + | #} | ||
| + | |||
| + | passdb ldap { | ||
| + | args = /etc/ | ||
| + | } | ||
| + | |||
| + | # заблокировать системные учетные записи | ||
| + | #userdb passwd { | ||
| + | #} | ||
| + | |||
| + | userdb ldap { | ||
| + | args = / | ||
| + | } | ||
| - | # See /usr/share/doc/postfix/ | + | ## dovecot-lda specific settings |
| - | # information on enabling SSL in the smtp client. | + | ## |
| + | 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 | ||
| + | } | ||
| + | | ||
| + | # 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 = / | ||
| + | #mode = 0660 | ||
| + | path = / | ||
| + | mode = 0660 | ||
| + | user = postfix | ||
| + | group = postfix | ||
| + | } | ||
| - | myhostname = daemon.drivesource.ru | + | } |
| - | alias_maps = hash:/ | + | |
| - | alias_database = hash:/ | + | |
| - | myorigin = / | + | |
| - | mydestination = daemon.drivesource.ru, | + | |
| - | relayhost = | + | |
| - | mynetworks = 127.0.0.0/8 [:: | + | |
| - | mailbox_size_limit = 0 | + | |
| - | message_size_limit = 0 | + | |
| - | virtual_mailbox_limit = 0 | + | |
| - | recipient_delimiter = | ||
| - | inet_interfaces = all | ||
| - | inet_protocols = all | ||
| </ | </ | ||
| - | Добавим учетные записи | + | Отредактируем файл **/ |
| - | < | + | < |
| - | groupadd | + | hosts = localhost |
| - | useradd | + | auth_bind = yes |
| + | auth_bind_userdn = uid=%u, | ||
| + | ldap_version = 3 | ||
| + | base = ou=Users, dc=drivesource, | ||
| + | |||
| + | # User attributes are given in LDAP-name=dovecot-internal-name list. The | ||
| + | # internal names are: | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # mail - Mail location | ||
| + | # | ||
| + | # There are also other special fields which can be returned, see | ||
| + | # http:// | ||
| + | user_attrs = | ||
| + | |||
| + | # Filter for user lookup. Some variables can be used (see | ||
| + | # http:// | ||
| + | # %u - username | ||
| + | # %n - user part in user@domain, | ||
| + | # %d - domain part in user@domain, | ||
| + | user_filter = (& | ||
| + | |||
| + | # 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. | ||
| + | # | ||
| + | # | ||
| </ | </ | ||
ubuntuserver810/postfix_vs_dovecot.1228082929.txt.gz · Last modified: (external edit)
