I’m using PHPMailer and it uses fsockopen to access the SMTP server.
But the machine has two IPs with different reverse DNS records. So in email headers I got the following:
Received: from one-server.tld (HELO another-server.tld) ...
I need to hide one-server.tld in favor of another-server.tld. But I need both IPs with their current RDNS settings.
I think its not possible using
fsockopen. But its possible incurl,fopenandstreamfunctions. What you need is stream_socket_client() function.Here are some ways to achieve it.
Using context parameters which can be used in fopen function family and stream function family. See the example.
Also stream_socket_client
Using socket_bind. PHP.NET got a simple example here.