I am using mailu
(docker mail server) as all-in-one mail server solution: pop3/imap/smtp with web-interface and so on. I can send emails from my vds to any other email and I can send email from one mailbox to another one using the same server (like, from hello@example.com
to bye@example.com
). However, when I send a text from gmail
(or any other mail server outside my vds) my webserver is not contacted at all and I have "recipient not found" message then. This happens from time to time and I don't know the reason for it.
My domain is example.co
and it has all needed records:
$ dig @8.8.8.8 example.co mx
; <<>> DiG 9.13.3 <<>> @8.8.8.8 example.co mx
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45588
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;example.co. IN MX
;; ANSWER SECTION:
example.co. 1799 IN MX 0 example.co.
example.co. 1799 IN MX 10 mailstore1.secureserver.net.
example.co. 1799 IN MX 1 smtp.secureserver.net.
;; Query time: 66 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Oct 27 18:34:54 MSK 2018
;; MSG SIZE rcvd: 117
And the domain is accessible of course. But sometimes (and now also) other mail servers can't reach mine:
If I test my mailbox (for example, noreply@example.co
) the service says:
X record found: example.co (Priority 0)
MX record found: smtp.secureserver.net (Priority 1)
MX record found: mailstore1.secureserver.net (Priority 10)
Connecting to example.co
Connect to example.co failed
Connecting to smtp.secureserver.net
Connected to smtp.secureserver.net
Dialog with smtp.secureserver.net ok
------------------------------------------------------------
220 p3plibsmtp01-08.prod.phx3.secureserver.net bizsmtp ESMTP server ready
HELO verifyemailaddress.org
250 p3plibsmtp01-08.prod.phx3.secureserver.net hello [209.126.119.123], pleased to meet you
MAIL FROM: <noreply@verifyemailaddress.org>
250 2.1.0 <noreply@verifyemailaddress.org> sender ok
RCPT TO: <noreply@example.co>
550 5.1.1 <noreply@example.co> Recipient not found. <http://x.co/irbounce>
QUIT
221 2.0.0 p3plibsmtp01-08.prod.phx3.secureserver.net bizsmtp closing connection
------------------------------------------------------------
Email address noreply@example.co rejected
I have no idea why anyone can't connect to my server but If I try to see whether I have opened ports or not, I see they actually are opened:
$ nmap example.co
Starting Nmap 7.70 ( https://nmap.org ) at 2018-10-27 18:48 MSK
Nmap scan report for .co (185.246.155.33)
Host is up (0.044s latency).
Not shown: 986 closed ports
PORT STATE SERVICE
25/tcp filtered smtp
465/tcp open smtps
587/tcp open submission
993/tcp open imaps
995/tcp open pop3s
Nmap done: 1 IP address (1 host up) scanned in 1.87 seconds
Interesting thing that from my home pc I see that 25/tcp
is opened and filtered but I can't see it from nmap
's output on my VDS (where it comes from)? If I telnet
these ports, all of them are opened successfully.
I don't expose 25
port for mailu
from the docker container, probably, this is the reason for the problem.
UPD: I have opened 25
port for mailu
and now gmail
sends email successfully and I receive it on my side. Why was it necessary?