I have a Centos server with cPanel on it.
Yesterday, some hackers had successfully connected to my smpt server and sent thousand of emails from it.
What I want to do is blocking every ports except for HTTP and HTTPS ports to everyone (IN and OUT), except to some ips (for admin purpose).
I've already did this for the past few months with smpt ports opened. This is working perfectly, but I want to know if blocking ports 25, 465 and 587 (IN and OUT) will prevent the server itself from sending emails. I have some php scripts which need to send emails.
I don't want any email accounts, so sending emails from a mail client is not necessary.