Instaluje prosty serwer mailowy na swojej maszynie (Debian 8) i wychodzę z siebie...
Kilka lat temu instalowałem również na starszym debianie i śmigał bezproblemowo, nie wiem na czym polega problem. Przeczytałem masę tutoriali i pół dokumentacji postfixa i dovecota a jako startowy tutorial wybrałem ten: http://jeyg.info/a-debian-mail-server-with-postfix-and-dovecot/.
A więc trochę informacji, które może pomogą w ustaleniu problemu:
Nie zmienialem domyslnej domeny serwera w hostach, która dla serwerow soyoustart wyglada nastepujaco: nsXXXXXX.ip--XX-XXX.eu.
Dla mojej domeny, nazwijmy ja example.com ustawilem rekordy A dla mail.example.com i utworzylem rekord MX.
Komenda dig wyświetla poprawna delegacje domeny:
dig example.com MX
;example.com. IN MX
;; ANSWER SECTION:
example.com. 83918 IN MX 10 mail.example.com.
;; ADDITIONAL SECTION:
mail.example.com. 83918 IN A XXX.XX.XXX.XX
postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
mailbox_size_limit = 0
mydestination = nsxxxxxxxx.ip-xxx-xx-xxx.eu, example.com, localhost, localhost.localdomain
mydomain = example.com
myhostname = nsxxxxxx.ip-xxx-xx-xxx.eu
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/mail.crt
smtpd_tls_key_file = /etc/ssl/private/mail.key
smtpd_use_tls = yes
etc/postfix/master.cf
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - - - - smtpd
#smtp inet n - - - 1 postscreen
#smtpd pass - - - - - smtpd
#dnsblog unix - - - - 0 dnsblog
#tlsproxy unix - - - - 0 tlsproxy
submission inet n - - - - smtpd
# -o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
# -o smtpd_reject_unlisted_recipient=no
# -o smtpd_client_restrictions=$mua_client_restrictions
# -o smtpd_helo_restrictions=$mua_helo_restrictions
# -o smtpd_sender_restrictions=$mua_sender_restrictions
# -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
# -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
smtps inet n - - - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
# -o smtpd_reject_unlisted_recipient=no
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o smtpd_helo_restrictions=$mua_helo_restrictions
# -o smtpd_sender_restrictions=$mua_sender_restrictions
# -o smtpd_recipient_restrictions=
# -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
doveconf -n
auth_debug_passwords = yes
auth_mechanisms = plain login
auth_verbose = yes
mail_debug = yes
mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_privileged_group = mail
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
driver = pam
}
protocols = " imap"
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
}
service imap-login {
inet_listener imaps {
port = 993
ssl = yes
}
}
ssl = required
ssl_cert = </etc/ssl/certs/mail.crt
ssl_key = </etc/ssl/private/mail.key
userdb {
driver = passwd
}
Z tymi ustawieniami, mogę się zalogować do IMAP pod portem 143 (a nie tak jak ustawilem pod szyforwanym 993) i wysylac maile w smtp z portu 25 również niezaszyfrowane...
Podczas proby polaczenia do imaps z zewnątrz przez port 993 w logach widzę:
dovecot: imap-login: Disconnected (no auth attempts in 32 secs): user=<>, rip=xx.8.xx.195, lip=xxx.xx.xxx.xxx, TLS handshaking: Disconnected, session=<ed2nkJ47cQBOCDvD>
tak jakby dane o logowaniu - login i haslo nie byly przekazywane do dovecota.
Probujac wyslac mail na zewnatrz uzywajac smtp zawsze otrzymuje ten blad:
postfix/smtpd[3538]: connect from XXXXXXXXX
postfix/smtpd[3538]: NOQUEUE: reject: RCPT from dynamic-xxxxxxxxxxx[xx.x.xx.xxx]: 554 5.7.1 <xxxx@gmail.com>: Relay access denied
Liczę na jakiekolwiek wskazówki, z góry dziekuję.