V
V
Viktor Taran2018-10-30 22:57:47
linux
Viktor Taran, 2018-10-30 22:57:47

How to correctly add mail.add_x_header logs to /var/log/mail.log?

The essence of the task is quite simple It is
necessary to enable by default for all sites

mail.add_x_header = On
mail.log = /var/log/mail.log

Allows you to write to the log file name and the line that sent the message.
[30-Oct-2018 22:55:20 Europe/Moscow] mail() on [/var/www/clients/client2/web2/web/mail.php:9]: To: [email protected] -- Headers:  -- Subject: My Subject

Very useful for spam bots.
Especially on a server with gov___sites, when there are a couple of hundred of them.
By default, you can turn it on
mail.log = syslog
. But it is already pretty dirty with bind proxy, etc., and since the system already has a log file responsible for mail, it would actually like to wrap it there, but it doesn’t wrap.
How to correctly force the system to save the log or in mail.log
debian 9

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question