So i found a solution and i going to share with everyone.
Requeriments
Linux
Ensim
root access
1. Go to virtualhost's apache conf in my server is /etc/httpd/conf/virtual
CODE
cd /etc/httpd/conf/virtual
2. Now you can list all sites in your server
CODE
ls
3. Now you have to edit each site's config file. [use your favorite file editor]
CODE
nano site1 <-- change filename for each site name listed on that directory
4. Search for ifModule mod_php (Mine looks like this <IfModule mod_php4.c>)
5. Inside that tag put the next code
CODE
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f emailcop@sitename" <-- replace sitename with the domain name of that client.
6. now search in the same file for ifmodule sapi_apache (Mine looks like this <IfModule sapi_apache2.c>)
7. Inside that tag put the same code as php tag code
CODE
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f emailcop@sitename" <-- replace sitename with the domain name of that client.
8. Save file
9. Repeat same procedure for each site listed on the directory
10. Finally restart apache/httpd
CODE
type: service httpd restart
Now you can look at your /var/log/maillog folder and see which site is sending email through php scritps the line will look something like this:
[
CODE
Jul 4 11:31:00 secure sendmail[7890]: m64FV0HG007890: Authentication-Warning: yourservername: apache set sender to emailcop@domainname using -f
Jul 4 11:31:07 secure sendmail[7890]: m64FV0HG007890: from=emailcop@domainname, size=308, class=0, nrcpts=1, msgid=<200807041531.m64FV0HG007890@yourservername>, relay=apache@localhost
Jul 4 11:31:07 secure sm-acceptingconnections[13146]: m64FV7cp013146: from=<emailcop@domainname>, size=665, class=0, nrcpts=1, msgid=<200807041531.m64FV0HG007890@yourservername>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Jul 4 11:31:07 secure sendmail[7890]: m64FV0HG007890: to=dest@domain-dest, ctladdr=emailcop@domainname (48/48), delay=00:00:07, xdelay=00:00:00, mailer=relay, pri=30308, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (m64FV7cp013146 Message accepted for delivery)
Voila!! email identified!! going out through domainanme, if you think is spam you should go to that domain root folder and scan for scripts sending email.
Thanks for reading
Feel free to suggest/comment.
