Port 25 connection refused

8 posts by 4 authors in: Forums > CMS Builder
Last Post: March 20, 2020   (RSS)

By gversion - March 15, 2020

Hello,

I have configured my email settings at /cmsb/admin.php?menu=admin&action=email to use Amazon SES API credentials using port 587.

I have noticed that my server's /var/log/mail.log is reporting connection refused entries on port 25.

I don't understand what script is trying to use port 25 to send emails.

I have set CMSB to send me an email whenever there is an error on the website.

I believe the error is related to the fact that EC2 instances have port 25 blocked by default:

https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/

Does CMSB send errors over localhost port 25 even though I have configured the email settings to use Amazon SES?

Thanks,

Greg

By kitsguru - March 15, 2020

Make sure you have "how to send email" set to "SMTP SERVER secure -- TLS"

Jeff Shields

By gversion - March 15, 2020

Thanks, Jeff - I have that option already selected.

Regards,

Greg

By Steve99 - March 16, 2020

I believe all notices from the cms use sendMessage which uses the method you've set in email settings.

Have you looked into the possibility of server control panel alerts from cpanel/plesk/etc?

By daniel - March 16, 2020

Hi Greg,

Do the refused connections in /var/log/mail.log record originating IP address, and if so, can you verify that your CMSB site's outgoing IP matches the ones in the log? It's not uncommon for bots to blindly send out SMTP requests to servers in the hopes that they don't have the port secured, so it's worth checking first if your site is the originator of the refused connections.

Thanks,
Daniel

Daniel
Technical Lead
interactivetools.com

By gversion - March 16, 2020

Hi Daniel,

Yes, the IP address is the local IP address of my EC2 instance. So does this imply it's probably not a bot?

Regards,

Greg

By gversion - March 20, 2020

Hi Daniel,

I found out I had a few errors in my code and it seems that the server was trying to send out notifications to me about these but for some reason just got stuck in a loop.

After resolving the coding issues and then clearing the mail log queue with the command below all is now running smoothly.

sudo postsuper -d ALL

I also decided to empty my mail.log file as this was very large (1GB+):

cat /dev/null > /var/log/mail.log

Thanks as always for the great support!

Regards,

Greg