Re: Reference in the mail header
| From: | Sean Coates | Date: | Mon, 19 Feb 2007 17:00:59 +0000 |
| Subject: | Re: Reference in the mail header | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-28076@lists.php.net to get a copy of this message | ||
Kristoffer Hultenius wrote:
> Hello everybody!
>
> As a webhost that offer PHP-support for hundreds of customers, I have a
> concern.
> The mail()-function is too easy to use for sending spam and even worse -
> there is (sometimes) almost impossible to trace the sender-account.
You can solve this (mostly) in admin-space by setting the sendmail_path,
creatively, in php.ini.
For example, I can send mail with this:
sean@sarcasm:~$ php -d "sendmail_path=/home/sean/bin/mailwrap
uniquehosthere" -r 'mail("sean", "subject", "message body
here");'
Here's /home/sean/bin/mailwrap:
(echo "X-host-tag: $1" ; cat -) | /usr/sbin/sendmail -t -i
And here's the resulting mail:
From sean@sarcasm Mon Feb 19 11:54:22 2007
X-Original-To: sean
X-host-tag: uniquehosthere
To: sean@sarcasm
Subject: subject
Date: Mon, 19 Feb 2007 11:54:22 -0500 (EST)
From: sean@sarcasm (Sean)
message body here
... I'm not shooting down your idea, but there _is_ a way to solve this
right away. (Perhaps I'm missing something obvious, but I don't see an
obvious way to get around this tag in userspace.) The sendmail_path
value could be set with php_admin_value in your VirtualHost config.
S