I am running the equivalent of
docker run --name james_run -p "25:25" -p "465:465" -p "587:587" -p "143:143" -p "993:993" --volume "$PWD/conf:/root/conf/" --volume "$PWD/var:/root/var/" apache/james:latest
in TestContainers
james = new GenericContainer(DockerImageName.parse("apache/james")).withExposedPorts(25, 465, 587, 143, 993, 8000).withFileSystemBind(EmailServerIT.class.getClassLoader().getResource("conf").getPath(),"/root/conf", BindMode.READ_WRITE).withFileSystemBind(EmailServerIT.class.getClassLoader().getResource("var").getPath(),"/root/var", BindMode.READ_WRITE);
But am getting a connection refused error whenever I try to send to the SMTP port:
Caused by: javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused (Connection refused))
I have set to try and avoid needing a keystore but am having no luck.
Please advise