Unable to connect to AWS EC2 instance on port 25 (SMTP) for sending emails from Bitbucket Cloud Pipelines

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

Summary

Unable to connect to AWS EC2 instance on port 25 (SMTP) for sending emails from Bitbucket Cloud Pipelines and it throws the below error:

com.sun.mail.util.MailConnectException: Couldn't connect to host, port: domain.com, 25; timeout -1;
Caused by: java.net.ConnectException: Connection timed out (Connection timed out)

Cause

AWS blocks outbound traffic on port 25 (SMTP) of all EC2 instances and Lambda functions by default. Due to this restriction, the connection timed out occurs in the Bitbucket Pipelines.

Solution


Last modified on Jan 26, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.