Changing outgoing IP for mails sent with PHP mail()

Hello everybody,

I am using Virtualmin to host websites with several IPs. For every website, I carefuly choose the right IP and I never forget to tick the “Send outgoing email for domain from IP --> Virutal server’s adress” option.

Still, I noticed that some mails are sent with the server default’s IP (thus not with the virutal server’s IP). After some research, I noted that thoses mails are in fact the ones that are sent by the websites themselves, actually by PHP scripts with the usual mail() function.

I would like to make sure that the mails sent by PHP scripts also get the virutal server’s IP. Is there some workaround in order to do so ?

Thank you in advance.

May I try a bump?