Есть Centos 6.2
Dovecot 2.1.0 (установлено из исходников)
Postfix 2.6.6 (установлено из репозитария)
Хочу сделать корпоративную почту. Начал с простого. Сначала установил вышеизложенные пакеты. Хотел для начала попробовать простую настройку. А потом сделать более сложную с tls/ssl, mysql, postfixadmin, roundcube, clamav и т.д.
Вот смотрите что получается.
Dovecot 2 конфиг:
Код: Выделить всё
protocols = pop3 imap lmtp
mail_uid = 1001
mail_gid = 1001
first_valid_uid = 1001
last_valid_uid = 1001
info_log_path = /var/log/dovecot.log
log_path = /var/log/dovecot.log
ssl = no
login_greeting = Welcome to IMAP/POP3 server
#mail_location = maildir:~/Maildir/
mail_location = maildir:%h
mail_debug = yes
auth_verbose = yes
auth_debug = yes
auth_debug_passwords = yes
# SSL
# http://wiki2.dovecot.org/SSL/DovecotConfiguration
#ssl = yes
#ssl_cert = </etc/pki/dovecot/certs/server.crt
#ssl_key = </etc/pki/dovecot/private/server.key
#
disable_plaintext_auth = no
auth_mechanisms = PLAIN LOGIN CRAM-MD5
# LDAP database
passdb {
args = /etc/dovecot/dovecot-ldap.conf
driver = ldap
}
# LDAP database
userdb {
args = /etc/dovecot/dovecot-ldap.conf
driver = ldap
}
service auth {
# unix_listener /var/spool/postfix/dovecot-auth {
unix_listener /var/spool/postfix/private/dovecot-auth {
user = postfix
group = postfix
mode = 0660
}
unix_listener auth-master {
user = vmail
group = vmail
mode = 0660
}
unix_listener auth-userdb {
user = vmail
group = vmail
mode = 0660
}
user=root
}
protocol lda {
hostname = pc.ru
mail_plugins = $mail_plugins
postmaster_address = server2@pc.ru
}
service pop3-login {
inet_listener pop3 {
address = *
port = 110
}
inet_listener pop3s {
address = *
port = 995
}
}
Код: Выделить всё
hosts = 192.168.213.200
dn = server2@pc.net
dnpass = server2
debug_level = 1
auth_bind = yes
ldap_version = 3
base = cn=Users,dc=pc,dc=net
deref = never
scope = subtree
default_pass_scheme = CRYPT
user_attrs = sAMAccountName=mail=maildir:/var/spool/mail/%u
user_filter = (&(ObjectClass=person)(sAMAccountName=%u))
pass_attrs = sAMAccountName=user
pass_filter = (&(ObjectClass=person)(sAMAccountName=%u))
Код: Выделить всё
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mail.pc.ru
mydomain = pc.ru
# SENDING MAIL
inet_interfaces = all
inet_protocols = all
mydestination = localhost.$mydomain, localhost, $mydomain
mynetworks = 127.0.0.0/8, 192.168.213.0/24
#virtual_mailbox_maps = ldap:/etc/postfix/ad/users.cf
local_recipient_maps = proxy:ldap:/etc/postfix/ad/users.cf
mail_spool_directory = /var/spool/mail/%u
smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
smtpd_sasl_security_options = noanonymous
virtual_minimum_uid = 1001
local_transport = dovecot
dovecot_destination_recipient_limit = 1
smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/spool/postfix/private/dovecot-auth
#alias_maps = hash:/etc/aliases
#alias_database = hash:/etc/aliases
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,
<------>permit_mynetworks,
<------>reject_unknown_helo_hostname,
<------>eject_non_fqdn_recipient,
<------>reject_unknown_recipient_domain,
<------>eject_unlisted_recipient,
<------>permit_auth_destination,
<------>reject_unauth_destination,
<------>reject_rbl_client bl.spamcop.net,
<------>reject_rbl_client cbl.abuseat.org,
<------>reject_rbl_client psbl.surriel.com,
<------>reject_rbl_client spamsources.fabel.dk,
<------>reject_rbl_client opm.blitzed.org,
<------>reject_rbl_client combined.njabl.org,
<------>reject_rbl_client dul.ru,
<------>reject_rbl_client dnsbl.sorbs.net,
<------>reject_rhsbl_sender rhsbl.sorbs.net,
<------>reject_rhsbl_client rhsbl.sorbs.net,
<------>reject_rhsbl_sender block.rhs.mailpolice.com,
<------>reject_rhsbl_client block.rhs.mailpolice.com,
<------>reject_unknown_client,
<------>reject_authenticated_sender_login_mismatch,
<------>reject_non_fqdn_sender,
<------>reject_sender_login_mismatch,
<------>reject_unauthenticated_sender_login_mismatch,
<------>reject_unlisted_sender,
<------>reject_unverified_sender,
<------>reject_unknown_sender_domain
smtpd_etrn_restrictions=permit_mynetworks, reject
smtpd_data_restrictions = reject_unauth_pipelining
message_size_limit=51200000
debug_peer_level = 3
smtpd_banner = $myhostname ESMTP
unknown_local_recipient_reject_code = 550
debugger_command =
<------> PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
<------> ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
Код: Выделить всё
server_host = 192.168.213.200:3268
search_base = dc=pc,dc=net
query_filter = (&(objectclass=person)(mail=%s))
result_attribute = sAMAccountName
result_format = %s/Maildir/
bind_dn = server2@pc.net
bind_pw = server2
bind = yes
version = 3
в каталоге /var/spool/mail/ создается папочка alex и в ней доп. папки. Если смотреть в логи dovecot.log там все без ошибок.
А вот если отправить самому себе письмо. То вот что пишет postfix
Код: Выделить всё
alhost postfix/smtpd[11848]: C671F60D76: client=sapr2.pc.net[192.168.213.88]
alhost postfix/cleanup[11842]: C671F60D76: message-id=<1555236475.20120221141314@pc.ru>
alhost postfix/qmgr[11833]: C671F60D76: from=<alex@pc.ru>, size=1021, nrcpt=1 (queue active)
alhost postfix/smtpd[11848]: disconnect from sapr2.pc.net[192.168.213.88]
alhost postfix/pipe[11835]: C671F60D76: to=<alex@pc.ru>, relay=dovecot, delay=0.12, delays=0.08/0/0/0.04, dsn=5.1.1, status=bounced (user unknown)
alhost postfix/cleanup[11843]: DA0AC60D8C: message-id=<20120227090901.DA0AC60D8C@mail.pc.ru>
alhost postfix/qmgr[11833]: DA0AC60D8C: from=<>, size=2707, nrcpt=1 (queue active)
alhost postfix/bounce[11841]: C671F60D76: sender non-delivery notification: DA0AC60D8C
alhost postfix/qmgr[11833]: C671F60D76: removed
alhost postfix/pipe[11836]: DA0AC60D8C: to=<alex@pc.ru>, relay=dovecot, delay=0.07, delays=0.03/0/0/0.04, dsn=5.1.1, status=bounced (user unknown)
alhost postfix/qmgr[11833]: DA0AC60D8C: removed
Код: Выделить всё
Feb 27 16:09:01 auth: Error: ** ld 0x8522858 Outstanding Requests:
Feb 27 16:09:01 auth: Error: * msgid 11, origid 11, status InProgress
Feb 27 16:09:01 auth: Error: outstanding referrals 0, parent count 0
Feb 27 16:09:01 auth: Error: ld 0x8522858 request count 1 (abandoned 0)
Feb 27 16:09:01 auth: Error: ** ld 0x8522858 Response Queue:
Feb 27 16:09:01 auth: Error: Empty
Feb 27 16:09:01 auth: Error: ld 0x8522858 response count 0
Feb 27 16:09:01 auth: Error: ldap_chkResponseList ld 0x8522858 msgid -1 all 0
Feb 27 16:09:01 auth: Error: ldap_chkResponseList returns ld 0x8522858 NULL
Feb 27 16:09:01 auth: Error: ldap_int_select
Feb 27 16:09:01 auth: Error: read1msg: ld 0x8522858 msgid -1 all 0
Feb 27 16:09:01 auth: Error: read1msg: ld 0x8522858 msgid 11 message type search-result
Feb 27 16:09:01 auth: Error: read1msg: ld 0x8522858 0 new referrals
Feb 27 16:09:01 auth: Error: read1msg: mark request completed, ld 0x8522858 msgid 11
Feb 27 16:09:01 auth: Error: request done: ld 0x8522858 msgid 11
Feb 27 16:09:01 auth: Error: res_errno: 0, res_error: <>, res_matched: <>
Feb 27 16:09:01 auth: Error: ldap_free_request (origid 11, msgid 11)
Feb 27 16:09:01 auth: Error: ldap_parse_result
Feb 27 16:09:01 auth: Info: ldap(alex@pc.ru): unknown user
Feb 27 16:09:01 auth: Debug: master out: NOTFOUND 1
Feb 27 16:09:01 auth: Error: ldap_msgfree
Feb 27 16:09:01 auth: Error: ldap_result ld 0x8522858 msgid -1
Feb 27 16:09:01 auth: Error: wait4msg ld 0x8522858 msgid -1 (timeout 0 usec)
Feb 27 16:09:01 auth: Error: wait4msg continue ld 0x8522858 msgid -1 all 0
Feb 27 16:09:01 auth: Error: ** ld 0x8522858 Connections:
Feb 27 16:09:01 auth: Error: * host: 192.168.213.200 port: 389 (default)
Feb 27 16:09:01 auth: Error: refcnt: 1 status: Connected
Feb 27 16:09:01 auth: Error: last used: Mon Feb 27 16:09:01 2012
Feb 27 16:09:01 auth: Error:
Feb 27 16:09:01 auth: Error:
Feb 27 16:09:01 auth: Error: ** ld 0x8522858 Outstanding Requests:
Feb 27 16:09:01 auth: Error: Empty
Feb 27 16:09:01 auth: Error: ld 0x8522858 request count 0 (abandoned 0)
Feb 27 16:09:01 auth: Error: ** ld 0x8522858 Response Queue:
Feb 27 16:09:01 auth: Error: Empty
Feb 27 16:09:01 auth: Error: ld 0x8522858 response count 0
Feb 27 16:09:01 auth: Error: ldap_chkResponseList ld 0x8522858 msgid -1 all 0
Feb 27 16:09:01 auth: Error: ldap_chkResponseList returns ld 0x8522858 NULL
Feb 27 16:09:01 auth: Error: ldap_int_select
Feb 27 16:09:01 lda: Debug: auth input:
Feb 27 16:11:42 auth: Error: ldap_unbind
Feb 27 16:11:42 auth: Error: ldap_free_connection 1 1
Feb 27 16:11:42 auth: Error: ldap_send_unbind
Feb 27 16:11:42 auth: Error: ldap_free_connection: actually freed