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:12] – 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 | + | Запишем в файл ** /etc/postfix/ldap-aliases.cf ** следующую конфигурацию |
| - | smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem | + | < |
| - | smtpd_tls_key_file=/ | + | server_host |
| - | smtpd_use_tls=yes | + | search_base |
| - | smtpd_tls_session_cache_database | + | query_filter |
| - | smtp_tls_session_cache_database | + | result_attribute |
| + | </code> | ||
| - | # See /usr/ | + | В конфигурацию транспорта **/etc/postfix/master.cf** |
| - | # information on enabling SSL in the smtp client. | + | < |
| + | dovecot | ||
| + | | ||
| + | </ | ||
| - | myhostname = daemon.drivesource.ru | + | Устанавливаем [[http:// |
| - | alias_maps = hash:/etc/aliases | + | < |
| - | alias_database | + | apt-get update |
| - | myorigin | + | apt-get install dovecot-common dovecot-imapd |
| - | mydestination | + | </ |
| - | relayhost | + | |
| - | mynetworks | + | Отредактируем основной файл конфигурации **/etc/dovecot/ |
| - | mailbox_size_limit | + | <code php> |
| - | message_size_limit | + | # Disable LOGIN command and all other plaintext authentications unless |
| - | virtual_mailbox_limit | + | # 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 = maildir:/var/vmail/%u | ||
| + | |||
| + | # 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 = / | ||
| + | auth_socket_path = / | ||
| + | } | ||
| + | |||
| + | # заблокировать системные учетные записи | ||
| + | #passdb pam { | ||
| + | #} | ||
| + | |||
| + | passdb ldap { | ||
| + | args = /etc/dovecot/ | ||
| + | } | ||
| + | |||
| + | # заблокировать системные учетные записи | ||
| + | #userdb passwd { | ||
| + | #} | ||
| + | |||
| + | userdb ldap { | ||
| + | args = / | ||
| + | } | ||
| + | |||
| + | ## dovecot-lda specific settings | ||
| + | ## | ||
| + | socket listen { | ||
| + | master { | ||
| + | path = / | ||
| + | | ||
| + | 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/ | ||
| + | # | ||
| + | | ||
| + | | ||
| + | user = postfix | ||
| + | group = postfix | ||
| + | } | ||
| + | |||
| + | } | ||
| - | recipient_delimiter = | ||
| - | inet_interfaces = all | ||
| - | inet_protocols = all | ||
| </ | </ | ||
| - | Добавим учетные записи | + | Отредактируем файл **/ |
| - | < | + | < |
| - | groupadd | + | hosts = localhost |
| - | useradd | + | auth_bind = yes |
| - | mkdir /var/vmail | + | auth_bind_userdn = uid=%u, |
| - | chown vmail.vmail /var/vmail | + | 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://wiki.dovecot.org/ | ||
| + | user_attrs = | ||
| + | |||
| + | # Filter for user lookup. Some variables can be used (see | ||
| + | # http://wiki.dovecot.org/ | ||
| + | # %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.1228083124.txt.gz · Last modified: (external edit)
