I have Ubuntu Server set up on a machine.
I have Virtualmin installed to manage my websites.
The idea is that 2-3 of them use open source platforms like Wordpress and I didn't had time to update them and so on and they got infected and now they are sending spam.
Is there anyway to make sure that no emails can be sent from my server without SMTP Authentification. I mean I want to make sure there is no way to use PHP mail function or postfix sending function or anything else without explicit auth.
Is there anyway to do this. Because I tried to do this from Virtual Min by disabling Mail server for each account, but this is not a good idea since it disables entire email function for that domain name.
I tried to find a way by Googling it to prevent scripts sending emails without auth but I can't find anything. I managed to limit the hourly limit for emails for 200 emails / hour and when I check postfix queue I see about 300000 emails in there. I made a cron job to flush them but thats not the perfect thing so blocking scripts to send email without auth would be a perfect thing until I get my websites fixed.
I will kindly appreciate any info.
LATER EDIT: MY SERVER IS NOT COMPROMISED, SO MY QUESTION IS VERY DIFFERENT FROM ANY OTHER DUPLICATES.