Hi,

I had set up my mailcow yesterday, and it was working just fine. However, in the afternoon, it stopped receiving mail from any addresses over the internet. It still receives mail sent from its own postfix server, and my email client on my laptop is able to read that mail just fine, so I don’t think it’s a firewall issue. I am also able to send mail from mailcow server to my gmail without issue, so it seems that SMTP is configured correctly.

My mailcow is hosted on a Linode server, so if I am able to read my mail locally via IMAP, that means IMAP should be configured correctly. I also confirmed that Linode does not have any firewalls in place except to block port 25, which I do not need anyway.

The best I could figure to debug was to send an email from my gmail, and monitor the dovecot logs for any errors. However, Dovecot does not even log receiving a connection from GMail.

Since I am fairly confident it’s not a firewall issue, I am thinking the issue is DNS. So, I am wondering if anyone can see anything in my records which I cannot.

commands from my laptop (over the internet):

┌────adam@chi:~ 
└─[$ dig +short adamcooper.sh mx  
10 mail.adamcooper.sh.
┌────adam@chi:~ 
└─[$ dig +short mail.adamcooper.sh
45.79.50.168
┌────adam@chi:~ 
└─[$ dig +short adamcooper.sh txt
"v=spf1 mx ~all"
┌────adam@chi:~ 
└─[$ dig +short _dmarc.adamcooper.sh txt
"v=DMARC1; p=reject; rua=mailto:mailauth-reports@adamcooper.sh"
┌────adam@chi:~ 
└─[$ dig +short dkim._domainkey.adamcooper.sh txt
"v=DKIM1;k=rsa;t=s;s=email;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0LCBD80etnyB67vFw11XIpxbQAcfrKu97t8RY+7bwEEYWH+Zjq5g7wHe4dMCxZ6j1lxwJOzlmb1c1JjKAhaM/Gb3/qTQwK8+5JPD3h5Gg1gQn57DMrJz0MQIpqiM67J1lOP6X9Qnu7G3HuymT0BKsyibZs23AQTtS3gVNyqOptbbW7TwBcv6MSG" "uZSUI+X0xeKUZ6ZDz8EGqGHskQb25IbsQdyeZjmSqe68Qi6XbylLKSa9Wl6ozbTP2fHsl9Qq7ZZ1H0yzhoNMDlM6Non7wb6/pU/jNBETSOQPJCB2v16Lhknrcha2lNfpK6IPVU7qyPrKJxqrjvDp+dlntA4IUfQIDAQAB"
┌────adam@chi:~ 
└─[$ nslookup 45.79.50.168
168.50.79.45.in-addr.arpa	name = mail.adamcooper.sh.

Authoritative answers can be found from:

┌────adam@chi:~ 
└─[$ nc -vz mail.adamcooper.sh 143
mail.adamcooper.sh [45.79.50.168] 143 (imap) open
┌────adam@chi:~ 
└─[$ nc -vz mail.adamcooper.sh 993
mail.adamcooper.sh [45.79.50.168] 993 (imaps) open

Commands from the Linode instance hosting my mail server:

root@localhost:~/Containers/mailcow# dig +short adamcooper.sh mx
10 mail.adamcooper.sh.
root@localhost:~/Containers/mailcow# dig +short mail.adamcooper.sh
45.79.50.168
root@localhost:~/Containers/mailcow# dig +short adamcooper.sh txt
"v=spf1 mx ~all"
root@localhost:~/Containers/mailcow# dig +short _dmarc.adamcooper.sh txt
"v=DMARC1; p=reject; rua=mailto:mailauth-reports@adamcooper.sh"
root@localhost:~/Containers/mailcow# dig +short dkim._domainkey.adamcooper.sh txt
"v=DKIM1;k=rsa;t=s;s=email;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0LCBD80etnyB67vFw11XIpxbQAcfrKu97t8RY+7bwEEYWH+Zjq5g7wHe4dMCxZ6j1lxwJOzlmb1c1JjKAhaM/Gb3/qTQwK8+5JPD3h5Gg1gQn57DMrJz0MQIpqiM67J1lOP6X9Qnu7G3HuymT0BKsyibZs23AQTtS3gVNyqOptbbW7TwBcv6MSG" "uZSUI+X0xeKUZ6ZDz8EGqGHskQb25IbsQdyeZjmSqe68Qi6XbylLKSa9Wl6ozbTP2fHsl9Qq7ZZ1H0yzhoNMDlM6Non7wb6/pU/jNBETSOQPJCB2v16Lhknrcha2lNfpK6IPVU7qyPrKJxqrjvDp+dlntA4IUfQIDAQAB"
root@localhost:~/Containers/mailcow# nslookup 45.79.50.168
168.50.79.45.in-addr.arpa	name = mail.adamcooper.sh.

Authoritative answers can be found from:

root@localhost:~/Containers/mailcow# nc -vz mail.adamcooper.sh 143
mail.adamcooper.sh [45.79.50.168] 143 (imap2) open
root@localhost:~/Containers/mailcow# nc -vz mail.adamcooper.sh 993
mail.adamcooper.sh [45.79.50.168] 993 (imaps) open
root@localhost:~/Containers/mailcow# source .env
root@localhost:~/Containers/mailcow# echo $MAILCOW_HOSTNAME
mail.adamcooper.sh

If nobody sees any issue, any steps on how to debug? I tried desperately to find a tool like MXToolbox but for IMAP, but it doesn’t seem any exist.

Also, if you want any information about my config, please ask!

Thank you!
Adam

  • No, you need an open port 25 so other mail servers can deliver mail to your server via SMTP. Ports 465 and 587 are only used by clients for sending mail.

    This is from Wikipedia (https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol):

    Communication between mail servers generally uses the standard TCP port 25 designated for SMTP.

    Mail clients however generally don’t use this, instead using specific “submission” ports. Mail services generally accept email submission from clients on one of:

    587 (Submission), as formalized in RFC 6409 (previously RFC 2476)
    465 This port was deprecated after RFC 2487, until the issue of RFC 8314.

    Using port 25 is probably defined in one of these RFCs or another one concerning SMTP.

    I’m not sure why you were able to receive mail with a blocked port 25 at all, though. But in the long run you won’t be able to run a mail server without this port open.

firewalls in place except to block port 25, which I do not need anyway.

This is your problem. You NEED port 25 since mail servers use SMTP to communicate with each other.

    Have something to say?

    Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

    accolon are ports 587 and 465 not good enough? Those are working fine, and I am able to send mail through them. Plus, isn’t SMTP for sending mail? I thought I receive mail via IMAP from other SMTP servers. The issue is that I am unable to receive mail, not send it. I can send it just fine. I was also able to receive mail for about 4 hours after I installed mailcow, and then it suddenly stopped receiving mail. Can you provide a resource or technical explanation about why I require port 25?

    No, you need an open port 25 so other mail servers can deliver mail to your server via SMTP. Ports 465 and 587 are only used by clients for sending mail.

    This is from Wikipedia (en.wikipedia.org Icon Simple Mail Transfer Protocol - Wikipedia

    ):

    Communication between mail servers generally uses the standard TCP port 25 designated for SMTP.

    Mail clients however generally don’t use this, instead using specific “submission” ports. Mail services generally accept email submission from clients on one of:

    587 (Submission), as formalized in RFC 6409 (previously RFC 2476)
    465 This port was deprecated after RFC 2487, until the issue of RFC 8314.

    Using port 25 is probably defined in one of these RFCs or another one concerning SMTP.

    I’m not sure why you were able to receive mail with a blocked port 25 at all, though. But in the long run you won’t be able to run a mail server without this port open.

      accolon Oh my goodness, you’re right. Thank you so much for your help 🙂 My mail cow is mooing very happily 🙂

      No one is typing