I have 2 servers. One of them has my Laravel app on it, the other has our exim email service. Laravel sends outgoing emails via smtp through the email server. Somehow, the email account that laravel uses keeps getting used as open SMTP relay to send thousands of spam emails.
None of the other email accounts are ever used to send spam like this. If I change the credentials on the Laravel server (different email account, different password), then the new one is used to send spam again. I use bitbucket as our git repo and the password credentials are stored in the .env file. If I disable sending on cpanel for that email account, then laravel is still able to send through the email server because the relay doesn't check the account hold status or process cpanel rules.
I have outgoing spam monitor set up on the cpanel server and that does show me when it happens and it will hold the outgoing mail but then that triggers the max deferrments and prevents the entire server from sending mail (which we use for the rest of our business).
At this point I'm at a loss for where to go from here... all I know is that someone is somehow using my laravel (or credentials stored there) to send spam and I can't seem to stop it.
Please help!
Edit: I'm currently on Laravel 5.7.29 due to it being a giant backend for our business that I haven't been able to upgrade past that so far because of dependencies/time limitations.
Update: I have now been able to update to Laravel 5.8.38 (not sure if this has any bearing on the current issue or not)