Current location: Hot Scripts Forums » Programming Languages » PHP » problem with PHP script on qmail server


problem with PHP script on qmail server

Reply
  #1 (permalink)  
Old 03-24-04, 04:49 PM
localrec localrec is offline
New Member
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
problem with PHP script on qmail server

Hi there, I'm the system admin on a linux virtual domain server (Suse Linux) and the web guy has placed a PHP script on our site in order to use some email features. Qmail is the current email program.

It's not working . . . and I'm not sure why. I've checked the qmail settings and the paths that I can find. But it's the first time I've worked with qmail, so it's possible I'm simply not aware of something obvious.

Here's his code:

<?php
(!empty($_GET['src']))? $src = $_GET['src'] : $src = 1;

switch($src){


default:



$name = $_POST['name'];
$email = $_POST['email'];
$comment = $_POST['comment'];


$subject = "WeB Email form";


$headers = "From: $name <$email>\n";
$headers .= "X-Sender: <$email>\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-Priority: 1\n";
$headers .= "Return-Path: $name <$email>\n";

$recipient = "admin@localrecommendations.com";


$message = $comment;

mail($recipient, $subject, $message, $headers);

$subject = "Thank you for visitng ";


$headers = "From: webmaster <dave@localrecommendations.com>\n";
$headers .= "X-Sender: <dave@localrecommendations.com>\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-Priority: 1\n";
$headers .= "Return-Path: webmaster <dave@localrecommendations.com>\n";

$recipient = $email;


$message = "Thank you $name, for your taking the time to visit Local Recommendations. If you had a question it will be answered as soon as possible";

mail($recipient, $subject, $message, $headers);

}
break:

?>

Any ideas? Thanks!!

Last edited by localrec; 03-24-04 at 05:22 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-24-04, 08:45 PM
michaeln michaeln is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Is this a script just anyone can fill out? If so you need to add some input checking into the script as it is a bit exploitable the way it is written.

What if someone entered:
one@email.com;two@email.com;three@email.com;four@email.com
etc. and entered an nice long spam email message in the place of their name?

That is only way way to exploit the script.

Second question. What is the switch statement for? It doesn't appear to have a purpose.

Third: Do you have the settings in your php.ini pointing to qmails sendmail interface thing? Can't remember what you would call it at the moment. It should be at like /usr/bin/sendmail

-Michael

Last edited by michaeln; 03-24-04 at 08:57 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-25-04, 02:49 PM
localrec localrec is offline
New Member
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
problem with PHP script on qmail server

I've checked the /usr/bin/sendmail and that's correct the best I can tell. I'm really at a loss as to why it's not working at all.

I'll forward the security notes on to the web guy, though. Thanks!!

Quote:
Originally Posted by michaeln
Is this a script just anyone can fill out? If so you need to add some input checking into the script as it is a bit exploitable the way it is written.

What if someone entered:
one@email.com;two@email.com;three@email.com;four@email.com
etc. and entered an nice long spam email message in the place of their name?

That is only way way to exploit the script.

Second question. What is the switch statement for? It doesn't appear to have a purpose.

Third: Do you have the settings in your php.ini pointing to qmails sendmail interface thing? Can't remember what you would call it at the moment. It should be at like /usr/bin/sendmail

-Michael
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with PHP/.htaccess script, when using Internet Explorer digioz PHP 7 07-27-07 12:17 AM
problem with php script kappler0 PHP 3 05-04-04 12:07 PM
Affiliate script (PHP) whtiebear Job Offers & Assistance 2 12-21-03 01:12 AM
PHP Search script problem vispa PHP 1 11-22-03 01:22 PM
Proven PHP Script not working on Windows 2000 server – any ideas? chimchim PHP 5 11-13-03 10:16 PM


All times are GMT -5. The time now is 07:06 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.