# Track php mail function by vhost

**URL:** <https://forums.interworx.com/t/track-php-mail-function-by-vhost/12206>\
**Category:** Hacks / Tools / Tips / Tricks\
**Tags:** track, spam, php, function, mail\
**Created:** [August 29, 2008, 1:24pm UTC](https://forums.interworx.com/t/track-php-mail-function-by-vhost/12206 "2008-08-29T13:24:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mainframe](https://forums.interworx.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@mainframe](https://forums.interworx.com/u/mainframe)\
**Post date:** [August 29, 2008, 1:24pm UTC](https://forums.interworx.com/t/track-php-mail-function-by-vhost/12206/1 "2008-08-29T13:24:32Z")

</div>

Often client php unsecure web scripts get abused by spammers and tracking which vhost is responsible for spam from maillog is simply impossible if there is no identificator for each vhost php mail() function. Here is how to add it to iworx vhost skeleton (or to vhost conf file).

```auto

nano -w /chroot/home/interworx/etc/vhost-base.conf
--- ADD ---
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f<<DOMAIN>>" 
--- ADD ---

```

---

<div class="post-metadata">

**Author:** ![system](https://forums.interworx.com/uploads/default/original/2X/4/40ab17cc34b792a0172b48ad1333b9ba9299a9a1.png) [@system](https://forums.interworx.com/u/system)\
**Post date:** [September 14, 2008, 6:05pm UTC](https://forums.interworx.com/t/track-php-mail-function-by-vhost/12206/2 "2008-09-14T18:05:51Z")

</div>

That’s pretty useful, thanks for sharing! 🙂

---

<div class="post-metadata">

**Author:** ![Ramon](https://forums.interworx.com/user_avatar/forums.interworx.com/ramon/32/2734_2.png) [@Ramon](https://forums.interworx.com/u/Ramon)\
**Post date:** [September 29, 2008, 5:49am UTC](https://forums.interworx.com/t/track-php-mail-function-by-vhost/12206/3 "2008-09-29T05:49:27Z")

</div>

This is very useful, one question:  
What is the easiest and fastest way to apply this to all existing http confs?

---

<div class="post-metadata">

**Author:** ![mainframe](https://forums.interworx.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@mainframe](https://forums.interworx.com/u/mainframe)\
**Post date:** [October 10, 2008, 4:39am UTC](https://forums.interworx.com/t/track-php-mail-function-by-vhost/12206/4 "2008-10-10T04:39:18Z")

</div>

I’m not sure if one can force iworx to update all vhost conf-s from templates - then probably you would have to write shell script that adds this line to every vhost file if not alreay there. Shouldn’t be too hard.
