I spent HOURS trying to debug "Connection Refused" and "Connection closed by foreign host" errors when trying to use telnet to troubleshoot my connection. I was also trying to connect from my email client (macOS mail) around the same time. Telnet had also worked earlier, so I was extremely confused as to why it suddenly stopped working. I stumbled upon fail2ban.log in my container. In short, when trying to get my macOS client working, I exceeded the number of failed login attempts and fail2ban put dovecot and postfix in jail! I got around it by whitelisting my ipaddresses (my ec2 instance and my local computer)
I finally got my macOS client working, but was not receiving test messages. I edited docker-compose.yml and temporarily disabled the spam filter (and fail2ban). Now I am getting mail. I will troubleshoot those and re-enable them next week, but thought this might be of help for others trying to troubleshoot.