Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
Unable to receive/send e-mails from Plesk hosted on Amazon Lightsail/AWS EC2 or Microsoft Azure instance.
-
Outgoing mail connections via 25 port are not possible, the following error can be found in
/var/log/maillog
:CONFIG_TEXT: dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[142.250.4.26]:25: Connection timed out)
-
The following error can be found in %plesk_dir%Mail Servers\Mail Enable\Logging:
CONFIG_TEXT: Communications Error: Socket connection to gmail-smtp-in.l.google.com failed (error 10060). The host was either not contactable or it rejected your connection. Socket Family = 2; Host=203.0.113.2; Port=25
-
It is possible to send out an email message locally (to a mailbox in Plesk).
-
The following warning can be seen in Tools & Settings > Mail Server Settings:
PLESK_WARN: You cannot send emails from Plesk because outbound connections on TCP ports 25 and 587 are blocked. Check the firewall settings or contact your hosting provider. If you are sure that the ports are already open, Plesk can recheck them. Start the recheck
Cause
SMTP ports are blocked by a firewall on the Amazon/Azure side or on the server.
Resolution
-
For AWS instance, submit a request to AWS support to have port 25 unblocked in accordance with Amazon documentation or set up mail relay as shown in our free Udemy course.
Warning: If you have Amazon Lightsail please explicitly mention in the link above that you need to remove the port block for LightSail, otherwise the AWS team will remove it for EC2 only.
-
For Microsoft Azure, contact support at Subscription Management Problem type: Request to enable Port 25 email flow.
-
If the Plesk Firewall is used, open mail port under Plesk > Tools & Settings > Firewall.
-
If the system or a third-party firewall is active on the server, make sure that it is not blocking the connection to the 25,465,995 ports.
-
In case of an intermediate firewall, it is required to contact the service provider.
Additional information
Unable to send emails using Plesk local mail server: Connection timed out or connection refused. (#4.4.1)
Which Ports Need To Be Opened for all Plesk Services to Work with a Firewall?
Comments
5 comments
I have already opened port 25 in lightsail firewall still the issue persists
Hello @Mickey,
Opening port 25 in the Lightsail firewall is always a good approach. By doing it, you can be sure that port 25 is opened on your side.
However, AWS blocks port 25 on their side directly, so it can be opened only by submitting a request to them using this link: https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request
Here is also AWS article regarding it: https://aws.amazon.com/ru/premiumsupport/knowledge-center/ec2-port-25-throttle/
Please explicitly mention in the request that you need to remove the port block for LightSail, otherwise the AWS team will remove it for EC2 only.
Hi,
Thank you for this! Did all that, now I can send emails, works just fine.
My only problem remains that I can receive emails only from GMail accounts.
Can you provide a solution for that?
[AWS Lightsail Plesk Hosting Stack]
Thank you!
Hello @Bogdan Damian,
Try to send an email from non-Gmail account and check the logs at /var/log/maillog. If the email is rejected by your server there will be a corresponding message there.
it`s a nightmare to use plesk on lighsail, I`m using SES for both ways, and I noticed that one email is coming other one bounce back "cannot find address", huge dns issues,
Please sign in to leave a comment.