Estou tentando configurar um servidor de email no VPS digitalocean.
O problema é que eu não posso telnet para 993, embora o firewall esteja inativo e o dovecot esteja escutando. Por favor me diga onde eu estou errado.
Eu segui este postfix, dovecot , mysql, spamassasin tutorial .
Meu sistema operacional do servidor:
lsb_release -a
resultados:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
Eu segui o tutorial até esta parte: telnet example.com 993
, o que resulta em:
telnet mysite.com 993
Trying 127.0.1.1...
Connected to mysite.com.
Escape character is '^]'.
Connection closed by foreign host.
eu verifiquei firewall: sudo ufw status
, o que resulta em:
Status: inactive
E se o dovecot está ativo: sudo netstat -plutn | grep 993
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 27460/dovecot
tcp6 0 0 :::993 :::* LISTEN 27460/dovecot
Dovecot -F não mostra erro, e abaixo está a saída do dovecot -n:
# 2.2.22 (fe789d2): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.13 (7b14904)
# OS: Linux 4.4.0-34-generic x86_64 Ubuntu 16.04.1 LTS ext4
auth_mechanisms = plain login
mail_location = maildir:/var/mail/vhosts/%d/%n
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 {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
protocols = imap lmtp pop3
service auth-worker {
user = vmail
}
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
unix_listener auth-userdb {
mode = 0600
user = vmail
}
user = dovecot
}
service imap-login {
inet_listener imap {
port = 0
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
}
}
ssl = required
ssl_cert = /etc/letsencrypt/live/mysite.com/fullchain.pem
ssl_key = /etc/letsencrypt/live/mysite.com/privkey.pem
userdb {
args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
driver = static
}
Telnet para postfix smtp está bem: telnet mysite.com smtp
resultados:
Trying 127.0.1.1...
Connected to mysite.com.
Escape character is '^]'.
220 mysite.com ESMTP Postfix (Ubuntu)
ehlo mysite.com
250-mysite.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.
Por favor ajude.
EDIT 1:
Ainda sem sorte com openssl s_client -connect mysite.com:993 -crlf
CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 305 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1515817904
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
Sem sorte com o thunderbird:
Em exibição: telnet mysite.com 110
às vezes é fechado imediatamente, às vezes atrasos por um minuto antes de fechar.
Trying 127.0.1.1...
Connected to mysite.com.
Escape character is '^]'.
Connection closed by foreign host.
Pelo que eu li em outro lugar, acho que deveria esperar essa linha: +OK Dovecot (Ubuntu) ready.
Mais informações: sudo netstat -pltn
result:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:34600 0.0.0.0:* LISTEN 27939/postgres
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 27886/mysqld
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 27434/master
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 27460/dovecot
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2409/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 27434/master
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 27460/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 27460/dovecot
tcp6 0 0 :::587 :::* LISTEN 27434/master
tcp6 0 0 :::110 :::* LISTEN 27460/dovecot
tcp6 0 0 :::80 :::* LISTEN 1519/apache2
tcp6 0 0 :::22 :::* LISTEN 2409/sshd
tcp6 0 0 :::25 :::* LISTEN 27434/master
tcp6 0 0 :::443 :::* LISTEN 1519/apache2
tcp6 0 0 :::993 :::* LISTEN 27460/dovecot
tcp6 0 0 :::995 :::* LISTEN 27460/dovecot
e btw ... isso tem alguma coisa a ver com sshd_config
> PasswordAuthentication no
Outra informação: sudo iptables-save
:
# Generated by iptables-save v1.6.0 on Sat Jan 13 12:55:47 2018
*filter
:INPUT ACCEPT [53354:9755959]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [48733:30432882]
COMMIT
# Completed on Sat Jan 13 12:55:47 2018