Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/styllloz/public_html/qa-include/qa-base.php on line 1175

Warning: session_start(): Cannot start session when headers already sent in /home/styllloz/public_html/qa-include/app/users.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/users.php on line 1267

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/page.php on line 356
How to change IP to send mail through php mail()? - code-flow.club | Q&A

How to change IP to send mail through php mail()?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
14 views
Good afternoon, dear community,

There is such problem: on the server (debian) installed apache and on it hangs a website on a certain IP (hereinafter IP2). Only on the server konfigurera 2 IP (hereinafter IP1 and IP2).
In /etc/network/interfaces eth0 is listed as IP1 and IP2 as eth0:0.

Through the website (which runs on IP2) with mail() to send mail. In the header of incoming mail contains such a line:
Received: from www-data by mail.XXXXXX.com with local (Exim 4.69),
where mail.XXXXXX.com — reverse DNS to IP1. There's also other titles featured IP1.

I need to have mail sent via IP2. And in headlines everywhere appeared IP2, not IP1. How to do it?

PS I'm not a sysadmin, and many do not know the intricacies. But what we have now — set up itself.

P. P. S. Found in Exim settings setting the System Mail Name, but there you can only specify one address it seems.
by | 14 views

2 Answers

0 like 0 dislike
PHP sends mail from sendmail client. And IP, which will be delivered to the mail is a server configuration option, ie PHP is unable to influence it in principle. From PHP you can only send via different servers on different IP. Accordingly, you need to raise a few mta on a different IP. But to send through them it is necessary will not function mail(), and class sending via smtp.
by
0 like 0 dislike
Might help the option interface=x.y.z.w in exim.conf.
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
asked May 4, 2019 by raebg
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
35,189 users