T
T
try4tune2010-12-17 20:49:32
Apache HTTP Server
try4tune, 2010-12-17 20:49:32

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

Good afternoon, dear community,

There is such a problem: apache is installed on the server (debian) and the site hangs on it at a certain IP (hereinafter referred to as IP2). In total, 2 IPs are configured on the server (hereinafter IP1 and IP2).
/etc/network/interfaces lists IP1 as eth0 and IP2 as eth0:0.

Through the site (which runs on IP2), the mail () function sends mail. The incoming mail header contains the following line:
Received: from www-data by mail.XXXXXX.com with local (Exim 4.69),
where mail.XXXXXX.com is reverse DNS for IP1. In the same place, IP1 appears in other headers.

It is necessary for me that mail went through IP2. And in the headers, IP2 was listed everywhere, not IP1. How to do it?

PS I'm not a system administrator, and I don't know many subtleties. But what is now - I set it up myself.

PPS I found the System Mail Name setting in the Exim settings, but only one address can be specified there, it seems.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
pentarh, 2010-12-18
@try4tune

Mail from php is sent by sendmail client. And the IP from which mail will be delivered is a server configuration parameter, i.e. PHP has no effect on this. From PHP, you can only send through different servers on different IPs. Accordingly, you need to raise several mta on different ips. But it will no longer be necessary to send through them with the mail () function, but with the sending class via smtp.

P
peter23, 2010-12-17
@peter23

Perhaps specifying the interface=xyzw option in Exim.conf will help.

F
Fader, 2019-10-26
@Fader

How to configure HELO in EXIM?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question