Есть необходимость поднять почтовый сервер, остановился на Posfix + Dovecot. Есть такая конфигурация:
postfix 2.6.6:
main.cf
Код: Выделить всё
soft_bounce = no
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
default_privs = nobody
myhostname = mail.company.kz
mydomain = company.kz
myorigin = $myhostname
inet_interfaces = all
mydestination = $myhostname, localhost.$myhostname, localhost
unknown_address_reject_code = 550
unverified_recipient_reject_code = 550
non_fqdn_reject_code = 550
multi_recipient_bounce_reject_code = 550
unknown_local_recipient_reject_code = 550
local_recipient_maps = $virtual_mailbox_maps, $virtual_alias_maps
mynetworks = 127.0.0.0/8
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mail_spool_directory = /var/spool/mail
smtpd_banner = $myhostname ESMTP
debug_peer_level = 4
debug_peer_list = 127.0.0.1
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $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
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
config_directory = /etc/postfix
smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
smtpd_forbidden_commands = CONNECT GET POST
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch
smtpd_sender_login_maps = mysql:/etc/postfix/sql/users.cf
smtpd_sasl_local_domain = $myorigin
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
check_policy_service unix:/var/spool/postfix/postgrey/socket
reject_non_fqdn_recipient,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client dialups.mail-abuse.org,
smtpd_tls_key_file = /etc/postfix/ssl/key.pem
smtpd_tls_cert_file = /etc/postfix/ssl/cert.pem
smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_scache
smtpd_tls_session_cache_timeout = 86400
receive_override_options = no_address_mappings
virtual_mailbox_base = /srv/mail
virtual_minimum_uid = 1000
virtual_uid_maps = static:1000
virtual_gid_maps = static:12
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/virtual_alias_domain_maps.cf
virtual_alias_maps =
proxy:mysql:/etc/postfix/sql/virtual_alias_maps.cf
proxy:mysql:/etc/postfix/sql/virtual_alias_domain_maps.cf,
proxy:mysql:/etc/postfix/sql/virtual_alias_domain_catchall_maps.cf
virtual_mailbox_maps =
proxy:mysql:/etc/postfix/sql/virtual_mailbox_maps.cf,
proxy:mysql:/etc/postfix/sql/virtual_alias_domain_mailbox_maps.cf
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/sql/virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
virtual_overquota_bounce = yes
content_filter=amavisfeed:[127.0.0.1]:10024
master.cf
Код: Выделить всё
smtp inet n - n - - smtpd
submission inet n - n - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_wrappermode=no
-o smtpd_tls_security_level=encrypt
-o smtpd_tls_auth_only=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
smtps inet n - n - - smtpd
-o smtpd_tls_wrappermode=no
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
relay unix - - n - - smtp
-o smtp_fallback_relay=
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d $(recipient)
amavisfeed unix - - n - 4 lmtp
-o lmtp_data_done_timeout=1200
-o lmtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o smtpd_restriction_classes=
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters,no_address_mappings
-o local_header_rewrite_clients=
-o smtpd_milters=
-o local_recipient_maps=
-o relay_recipient_maps=
Код: Выделить всё
May 11 10:40:07 mail postfix/smtpd[5949]: connect from forward5o.mail.yandex.net[37.140.190.34]
May 11 10:40:07 mail postfix/smtpd[5949]: fatal: no SASL authentication mechanisms
May 11 10:40:08 mail postfix/master[39186]: warning: process /usr/libexec/postfix/smtpd pid 5949 exit status 1
May 11 10:40:08 mail postfix/master[39186]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Настройки dovecot
dovecot.conf
Код: Выделить всё
dict {
#quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
#expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}
!include conf.d/*.conf
!include_try local.conf
Код: Выделить всё
disable_plaintext_auth = no
auth_realms = company.kz
auth_default_realm = company.kz
auth_mechanisms = plain login
!include auth-sql.conf.ext
Код: Выделить всё
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
}
service pop3-login {
inet_listener pop3 {
port = 110
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
service lmtp {
unix_listener lmtp {
}
}
service imap {
}
service pop3 {
}
service auth {
unix_listener auth-userdb {
mode = 0666
user = vmail
group = vmail
}
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
}
service auth-worker {
}
service dict {
unix_listener dict {
}
}
Код: Выделить всё
May 8 17:33:16 mail postfix/submission/smtpd[40499]: connect from unknown[192.168.0.190]
May 8 17:33:16 mail postfix/submission/smtpd[40499]: E07465C0A0B: client=unknown[192.168.0.190], sasl_method=PLAIN, sasl_username=testuser@company.kz
May 8 17:33:16 mail postfix/cleanup[40510]: E07465C0A0B: message-id=<554CBA99.6030306@company.kz>
May 8 17:33:16 mail postfix/qmgr[39189]: E07465C0A0B: from=<testuser@company.kz>, size=562, nrcpt=1 (queue active)
May 8 17:33:17 mail postfix/lmtp[40511]: vstream_buf_get_ready: fd 12 got 49
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 220 [127.0.0.1] ESMTP amavisd-new service ready
May 8 17:33:17 mail postfix/lmtp[40511]: > 127.0.0.1[127.0.0.1]:10024: LHLO mail.company.kz
May 8 17:33:17 mail postfix/lmtp[40511]: vstream_fflush_some: fd 12 flush 19
May 8 17:33:17 mail postfix/lmtp[40511]: vstream_buf_get_ready: fd 12 got 154
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250-[127.0.0.1]
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250-VRFY
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250-PIPELINING
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250-SIZE
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250-ENHANCEDSTATUSCODES
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250-8BITMIME
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250-DSN
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250 XFORWARD NAME ADDR PORT PROTO HELO IDENT SOURCE
May 8 17:33:17 mail postfix/lmtp[40511]: server features: 0x49f8f size 0
May 8 17:33:17 mail postfix/lmtp[40511]: Using LMTP PIPELINING, TCP send buffer size is 4096
May 8 17:33:17 mail postfix/lmtp[40511]: > 127.0.0.1[127.0.0.1]:10024: XFORWARD NAME=unknown ADDR=192.168.0.190 PORT=35711
May 8 17:33:17 mail postfix/lmtp[40511]: > 127.0.0.1[127.0.0.1]:10024: XFORWARD PROTO=ESMTP HELO=[192.168.0.190] SOURCE=REMOTE
May 8 17:33:17 mail postfix/lmtp[40511]: > 127.0.0.1[127.0.0.1]:10024: MAIL FROM:<testuser@company.kz> SIZE=562
May 8 17:33:17 mail postfix/lmtp[40511]: > 127.0.0.1[127.0.0.1]:10024: RCPT TO:<megabuben@yandex.ru> ORCPT=rfc822;klaider@yandex.ru
May 8 17:33:17 mail postfix/lmtp[40511]: > 127.0.0.1[127.0.0.1]:10024: DATA
May 8 17:33:17 mail postfix/lmtp[40511]: vstream_fflush_some: fd 12 flush 219
May 8 17:33:17 mail postfix/lmtp[40511]: vstream_buf_get_ready: fd 12 got 23
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250 2.5.0 Ok XFORWARD
May 8 17:33:17 mail postfix/lmtp[40511]: vstream_buf_get_ready: fd 12 got 148
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250 2.5.0 Ok XFORWARD
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250 2.1.0 Sender <testuser@company.kz> OK
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 250 2.1.5 Recipient <megabuben@yandex.ru> OK
May 8 17:33:17 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 354 End data with <CR><LF>.<CR><LF>
May 8 17:33:17 mail postfix/lmtp[40511]: vstream_buf_get_ready: fd 11 got 566
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 56 data Received:
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 54 data ?by mail.e
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 64 data ?for <klai
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 38 data Message-ID
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 37 data Date: Fri,
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 36 data From: devc
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 86 data User-Agent
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 17 data MIME-Versi
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 21 data To: klaide
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 22 data Subject: )
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 54 data Content-Ty
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 31 data Content-Tr
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 0 data
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type N len 18 data dfasdfasdf
May 8 17:33:17 mail postfix/lmtp[40511]: rec_get: type X len 0 data
May 8 17:33:17 mail postfix/lmtp[40511]: > 127.0.0.1[127.0.0.1]:10024: .
May 8 17:33:17 mail postfix/lmtp[40511]: > 127.0.0.1[127.0.0.1]:10024: QUIT
May 8 17:33:17 mail postfix/lmtp[40511]: vstream_fflush_some: fd 12 flush 571
May 8 17:33:17 mail postfix/submission/smtpd[40499]: disconnect from unknown[192.168.0.190]
May 8 17:33:17 mail postfix/smtpd[40514]: connect from forward12p.cmail.yandex.net[87.250.241.138]
May 8 17:33:17 mail postfix/smtpd[40514]: fatal: no SASL authentication mechanisms
May 8 17:33:18 mail postfix/smtpd[40515]: connect from mail.company.kz[127.0.0.1]
May 8 17:33:18 mail postfix/smtpd[40515]: >>> START Client host RESTRICTIONS <<<
May 8 17:33:18 mail postfix/smtpd[40515]: generic_checks: name=permit_mynetworks
May 8 17:33:18 mail postfix/smtpd[40515]: permit_mynetworks: mail.company.kz 127.0.0.1
May 8 17:33:18 mail postfix/smtpd[40515]: match_hostname: mail.company.kz ~? 127.0.0.0/8
May 8 17:33:18 mail postfix/smtpd[40515]: match_hostaddr: 127.0.0.1 ~? 127.0.0.0/8
May 8 17:33:18 mail postfix/smtpd[40515]: generic_checks: name=permit_mynetworks status=1
May 8 17:33:18 mail postfix/smtpd[40515]: > mail.company.kz[127.0.0.1]: 220 mail.e100.kz ESMTP
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_create: SASL service=smtp, realm=mail.company.kz
May 8 17:33:18 mail postfix/smtpd[40515]: name_mask: noanonymous
May 8 17:33:18 mail postfix/smtpd[40515]: name_mask: noplaintext
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_connect: Connecting
May 8 17:33:18 mail postfix/smtpd[40515]: vstream_fflush_some: fd 12 flush 23
May 8 17:33:18 mail postfix/smtpd[40515]: vstream_buf_get_ready: fd 12 got 117
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_connect: auth reply: VERSION?1?1
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_connect: auth reply: MECH?PLAIN?plaintext
May 8 17:33:18 mail postfix/smtpd[40515]: name_mask: plaintext
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_connect: auth reply: MECH?LOGIN?plaintext
May 8 17:33:18 mail postfix/smtpd[40515]: name_mask: plaintext
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_connect: auth reply: SPID?40502
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_connect: auth reply: CUID?3
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_connect: auth reply: COOKIE?c2ba059af9d1f8c3c550575dc4f28701
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_connect: auth reply: DONE
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_mech_filter: skip mechanism: PLAIN
May 8 17:33:18 mail postfix/smtpd[40515]: xsasl_dovecot_server_mech_filter: skip mechanism: LOGIN
May 8 17:33:18 mail postfix/smtpd[40515]: fatal: no SASL authentication mechanisms
May 8 17:33:18 mail postfix/master[39186]: warning: process /usr/libexec/postfix/smtpd pid 40514 exit status 1
May 8 17:33:18 mail postfix/master[39186]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
May 8 17:33:19 mail postfix/master[39186]: warning: process /usr/libexec/postfix/smtpd pid 40515 exit status 1
May 8 17:33:19 mail postfix/master[39186]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
May 8 17:33:19 mail amavis[29842]: (29842-18) (!)tCH0TZohcsrV FWD from <testuser@company.kz> -> <megabuben@yandex.ru>, 451 4.5.0 From MTA() during fwd-connect (No greeting, dt: 1.007 s): id=29842-18
May 8 17:33:19 mail amavis[29842]: (29842-18) Blocked MTA-BLOCKED {TempFailedOutbound}, MYNETS LOCAL [192.168.0.190]:35711 <testuser@company.kz> -> <megabuben@yandex.ru>, Message-ID: <554CBA99.6030306@e100.kz>, mail_id: tCH0TZohcsrV, Hits: -1, size: 562, 2307 ms
May 8 17:33:19 mail postfix/lmtp[40511]: vstream_buf_get_ready: fd 12 got 130
May 8 17:33:19 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 451 4.5.0 id=29842-18 - Temporary MTA failure on relaying, From MTA() during fwd-connect (No greetin
May 8 17:33:19 mail postfix/lmtp[40511]: connect to subsystem private/defer
May 8 17:33:19 mail postfix/lmtp[40511]: send attr nrequest = 0
May 8 17:33:19 mail postfix/lmtp[40511]: send attr flags = 0
May 8 17:33:19 mail postfix/lmtp[40511]: send attr queue_id = E07465C0A0B
May 8 17:33:19 mail postfix/lmtp[40511]: send attr original_recipient = megabuben@yandex.ru
May 8 17:33:19 mail postfix/lmtp[40511]: send attr recipient = megabuben@yandex.ru
May 8 17:33:19 mail postfix/lmtp[40511]: send attr offset = 665
May 8 17:33:19 mail postfix/lmtp[40511]: send attr dsn_orig_rcpt = rfc822;megabuben@yandex.ru
May 8 17:33:19 mail postfix/lmtp[40511]: send attr notify_flags = 0
May 8 17:33:19 mail postfix/lmtp[40511]: send attr status = 4.5.0
May 8 17:33:19 mail postfix/lmtp[40511]: send attr diag_type = smtp
May 8 17:33:19 mail postfix/lmtp[40511]: send attr diag_text = 451 4.5.0 id=29842-18 - Temporary MTA failure on relaying, From MTA() during fwd-connect (No greeting, dt: 1.007 s): id=29842-18
May 8 17:33:19 mail postfix/lmtp[40511]: send attr mta_type = dns
May 8 17:33:19 mail postfix/lmtp[40511]: send attr mta_mname = 127.0.0.1
May 8 17:33:19 mail postfix/lmtp[40511]: send attr action = delayed
May 8 17:33:19 mail postfix/lmtp[40511]: send attr reason = host 127.0.0.1[127.0.0.1] said: 451 4.5.0 id=29842-18 - Temporary MTA failure on relaying, From MTA() during fwd-connect (No greeting, dt: 1.007 s): id=29842-18 (in reply to end of DATA command)
May 8 17:33:19 mail postfix/lmtp[40511]: vstream_fflush_some: fd 13 flush 588
May 8 17:33:19 mail postfix/lmtp[40511]: vstream_buf_get_ready: fd 13 got 10
May 8 17:33:19 mail postfix/lmtp[40511]: private/defer socket: wanted attribute: status
May 8 17:33:19 mail postfix/lmtp[40511]: input attribute name: status
May 8 17:33:19 mail postfix/lmtp[40511]: input attribute value: 0
May 8 17:33:19 mail postfix/lmtp[40511]: private/defer socket: wanted attribute: (list terminator)
May 8 17:33:19 mail postfix/lmtp[40511]: input attribute name: (end)
May 8 17:33:19 mail postfix/lmtp[40511]: E07465C0A0B: to=<megabuben@yandex.ru>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.4, delays=0.12/0/0/2.3, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 id=29842-18 - Temporary MTA failure on relaying, From MTA() during fwd-connect (No greeting, dt: 1.007 s): id=29842-18 (in reply to end of DATA command))
May 8 17:33:19 mail postfix/lmtp[40511]: flush_add: site yandex.ru id E07465C0A0B
May 8 17:33:19 mail postfix/lmtp[40511]: match_hostname: yandex.ru ~? mail.company.kz
May 8 17:33:19 mail postfix/lmtp[40511]: match_hostname: yandex.ru ~? localhost.mail.company.kz
May 8 17:33:19 mail postfix/lmtp[40511]: match_hostname: yandex.ru ~? localhost
May 8 17:33:19 mail postfix/lmtp[40511]: match_list_match: yandex.ru: no match
May 8 17:33:19 mail postfix/lmtp[40511]: flush_add: site yandex.ru id E07465C0A0B status 4
May 8 17:33:19 mail postfix/lmtp[40511]: smtp_loop: got 1 of 1 end-of-data replies
May 8 17:33:19 mail postfix/lmtp[40511]: vstream_buf_get_ready: fd 12 got 64
May 8 17:33:19 mail postfix/lmtp[40511]: < 127.0.0.1[127.0.0.1]:10024: 221 2.0.0 [127.0.0.1] amavisd-new closing transmission channel
May 8 17:33:19 mail postfix/lmtp[40511]: name_mask: resource
May 8 17:33:19 mail postfix/lmtp[40511]: name_mask: software