SMTP Verification Fails in Docker with "Connection refused (os error 111)"
Author: Nithin6524Created Mar 22, 2026Updated May 11, 2026
SMTP Verification Fails in Docker with "Connection refused (os error 111)"
Description
When running the backend server inside a Docker container, SMTP-based email verification fails with the following error:
"message": "Connection refused (os error 111)"This occurs while attempting to verify email reachability.
Steps to Reproduce
- Run the backend service inside a Docker container
- Trigger email validation for a Gmail address (e.g.,
[email protected]) - Observe the validation response
Expected Behavior
- SMTP verification should successfully connect to the recipient mail server
is_reachableshould return a definitive value (trueorfalse)
Actual Behavior
SMTP connection fails with:
Connection refused (os error 111)is_reachableis returned as"unknown"
Relevant Output
"smtp": {
"error": {
"type": "IOError",
"message": "Connection refused (os error 111)"
}
}Source: reacherhq/check-if-email-exists