Debian 9 Stretch - Serveur LAMP - Serveur MAIL Postfix & cie - TIPS
Dernière mise à jour Dimanche 17 Février 2019 • 840 consultations Avoir un fichier log des emails envoyés par l'intermédiaire de la fonction mail() de PHP s'avére utile pour repérer les scripts qui balancent des emails depuis votre serveur... $ sudo nano /etc/php5/apache2/php.ini ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path ; sendmail_path sendmail_path = /usr/sbin/sendmail -t -i mail.add_x_header = On mail.log = /var/log/phpmail.log Les trois lignes ajoutées (en rouge ci-dessus) ont pour fonction:
$ sudo touch /var/log/phpmail.log $ sudo chmod 777 /var/log/phpmail.log
$ sudo service apache2 restart
$ sudo tail -f /var/log/phpmail.log[18-Aug-2015 16:06:50 Europe/Paris] mail() on [/var/www/chemin/vers/script/mail.php:175]: To: **** -- ***** ****** *** ** *** *** ** |
![]() |