From 34f929ed6bc4e113f74a5c1e7c2f9a53673a915e Mon Sep 17 00:00:00 2001 From: Steve Johnson Date: Mon, 1 Jan 2018 14:20:58 -0700 Subject: [PATCH] Updated Debugging (markdown) --- .../config/troubleshooting/debugging.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/content/config/troubleshooting/debugging.md b/docs/content/config/troubleshooting/debugging.md index af057040..21ad00d1 100644 --- a/docs/content/config/troubleshooting/debugging.md +++ b/docs/content/config/troubleshooting/debugging.md @@ -24,3 +24,22 @@ neither in the dovecot logs sudo su docker exec -it apt-get install -y vim ``` +## Testing Connection +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) + +```bash +sudo su +docker exec -ti mail bash +cd /var/log +cat fail2ban.log | grep dovecot + +# Whitelist ip addresses: +fail2ban-client set dovecot addignoreip 172.18.0.1 +fail2ban-client set dovecot addignoreip 75.171.128.95 +fail2ban-client set postfix addignoreip 75.171.128.95 +fail2ban-client set postfix addignoreip 172.18.0.1 + +# this will delete the jails entirely +fail2ban-client stop dovecot +fail2ban-client stop postfix +```