0

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

ca55idy
  • 105
  • 1
  • 9
  • Can you share the client code are you using to connect against the Apache James, please? Take into account you need to use the random port provided by Testcontainers james.getMappedPort() – Eddú Meléndez Jun 20 '23 at 13:45

0 Answers0