Answer the question
In order to leave comments, you need to log in
How to configure exim4 to send mail from a site?
Briefly in order. There is one web server...
It is made so that php scripts of each site are executed from different users. That is, one site - one user in the system.
For example, there is a user site1. And let's say a script is executed from this site with sending a letter through the built-in mail () function (which calls sendmail, which is actually a symlink to exim4).
When this letter reaches the addressee, the local user of the server who sent it (site1) is scorched in its headers. In fact, this is the login of the user in the system from under which the script was launched to send this letter and the local hostname of the machine itself.
So I would like to know how to change this sending address ([email protected]) to any other email address (within the domains hanging on this IP)?
For example, so that each site sends a letter from under its own domain. For example [email protected]
UPDATE 1
Found the /etc/email-addresses file where you can specify outgoing mail for each local user.
For example, in my case, adding the following line there:
# user: email
site1: [email protected]
Answer the question
In order to leave comments, you need to log in
The task was solved by editing and bringing the default header Received to normal:
We remove the local user name and Exim version from there.
To do this, you need to insert into the config /etc/exim4/exim4.conf.template right before the begin acl section:
received_header_text = Received: \
by $primary_hostname \
${if def:received_protocol {with $received_protocol}} \
${if def:sender_address \
{(envelope-from <$sender_address>)\n\t}}\
${if def:tls_in_cipher {($tls_in_cipher)\n\t}}\
id $message_exim_id\
${if def:received_for {\n\tfor $received_for}}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question