Jump to content

wish to get log of scripts that send out emails


jasonc

Recommended Posts

I have only just been made aware of a problem with my coding and face 100's of emails being sent to my main email account due to an incorrectly formed variable in my code!!

 

i now wish to find out which site and script file is sending out these emails and have looked at logs provided by my host but these do not show much apart from the date and time how do i get a list of these files as someone i once knew and can not get hold of now once had this sort of thing and was able to get a list of the scripts and site urls that sent out the emails.

 

hope someone can help out as i am now getting way to many on my phone to cope with. as i use my phone mainly for this address and can not possibly change it now.

Link to comment
Share on other sites

 

where do i put this?

 

---

vi /etc/php5/apache2/php.ini

;sendmail_path =

sendmail_path ="/usr/sbin/sendmail_wrapper"

auto_prepend_file ="/etc/set_php_headers.php"

 

vi /usr/sbin/sendmail_wrapper

#!/bin/sh

logger -p mail.info vhostmail: site=${HTTP_HOST}, client=${REMOTE_ADDR}, script=${SCRIPT_NAME}

/usr/sbin/sendmail -t -i $*

 

chmod 755 /usr/sbin/sendmail_wrapper

 

vi /etc/set_php_headers.php

<?php

putenv("HTTP_HOST=". $_SERVER["HTTP_HOST"]);

putenv("SCRIPT_NAME=". $_SERVER["SCRIPT_NAME"]);

putenv("REMOTE_ADDR=". $_SERVER["REMOTE_ADDR"]);

?>

---

Link to comment
Share on other sites

vi is a text editor for Linux, so the command...

 

vi /etc/php5/apache2/php.ini

 

Is saying open /etc/php5/apache2/php.ini and edit it (the php.ini file may or may not be in this same location on your system).

 

The other two files in stevie's example will need to be created.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.