473,614 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mail() sends as "nobody", causing server error

I'm troubleshooting a program that I didn't build, so forgive me on
this one. It's called email.php, and it looks like a program that the
original developer must have downloaded from somewhere.

The part of the program that sends an email states this:

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
if (isset($_REQUES T["bcc"])){ $headers .= 'Bcc: '.$bcc. "\r\n"; }
$headers .= 'From: '.$from.'' . "\r\n";
if (isset($_REQUES T["cc"])){ $headers .= 'cc: '.$cc. "\r\n"; }
if (isset($_REQUES T["bcc"])){ $headers .= 'Bcc: '.$bcc. "\r\n"; }

// Mail it
error_reporting (E_ERROR | E_WARNING | E_PARSE);
mail($to, $subject, $message, $headers) or die("<h3>Cannot send mail.</
h3><br>mail(to, subject, message, headers)<br>mai l($to, $subject,
$message, $headers)");
header("Locatio n:".$_REQUEST["LocOK"]);
exit;

(Note, this is copy-and-pasted, and I know that the BCC field is in
there twice, but I left it verbatim in case there's an error there
that's causing my problem. The BCC field isn't utilized with the form,
though, so I think this error is irrelevant.)

The problem is that when it emails out, the server recognizes it as
coming from "nobody," which is automatically bounced to me. I set the
server up to refuse "nobody" emails as a hack-attack preventative, but
it's usually not a problem... until now.

I COULD change the server to allow "nobody" emails, but I would rather
not. Is there a way to modify the script to show the sender as
something besides "nobody"? Having something in the $from variable
doesn't seem to be enough.

This is just a guess, but based on the bounced message, I assume I
need to include the $from variable in the following fields that
currently say "nobody":

Return-path: no****@mydomain .com
Received: from no****@mydomain .com
(envelope-from <no****@mydomai n.com>)

Any ideas?

TIA,

Jason

Mar 28 '07 #1
4 3891
On 27 Mar 2007 22:54:53 -0700, "Jason" <jw*******@gmai l.comwrote:

>This is just a guess, but based on the bounced message, I assume I
need to include the $from variable in the following fields that
currently say "nobody":

Unless I'm missiing something, you don't have a From: line in your
headers at all!
<http://www.php.net/mail/>
--
Locate your Mobile phone: <http://www.bizorg.co.u k/news.html>
Great gifts: <http://www.ThisBritain .com/ASOS_popup.html >
Mar 28 '07 #2
Jason wrote:
if (isset($_REQUES T["bcc"])){ $headers .= 'Bcc: '.$bcc. "\r\n"; }
$headers .= 'From: '.$from.'' . "\r\n";
if (isset($_REQUES T["cc"])){ $headers .= 'cc: '.$cc. "\r\n"; }
if (isset($_REQUES T["bcc"])){ $headers .= 'Bcc: '.$bcc. "\r\n"; }
Argh!!!

This script will become a source of spam.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Mar 28 '07 #3
Jason wrote:
I'm troubleshooting a program that I didn't build, so forgive me on
this one. It's called email.php, and it looks like a program that the
original developer must have downloaded from somewhere.

The part of the program that sends an email states this:

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
if (isset($_REQUES T["bcc"])){ $headers .= 'Bcc: '.$bcc. "\r\n"; }
$headers .= 'From: '.$from.'' . "\r\n";
if (isset($_REQUES T["cc"])){ $headers .= 'cc: '.$cc. "\r\n"; }
if (isset($_REQUES T["bcc"])){ $headers .= 'Bcc: '.$bcc. "\r\n"; }

// Mail it
error_reporting (E_ERROR | E_WARNING | E_PARSE);
mail($to, $subject, $message, $headers) or die("<h3>Cannot send mail.</
h3><br>mail(to, subject, message, headers)<br>mai l($to, $subject,
$message, $headers)");
header("Locatio n:".$_REQUEST["LocOK"]);
exit;

(Note, this is copy-and-pasted, and I know that the BCC field is in
there twice, but I left it verbatim in case there's an error there
that's causing my problem. The BCC field isn't utilized with the form,
though, so I think this error is irrelevant.)

The problem is that when it emails out, the server recognizes it as
coming from "nobody," which is automatically bounced to me. I set the
server up to refuse "nobody" emails as a hack-attack preventative, but
it's usually not a problem... until now.

I COULD change the server to allow "nobody" emails, but I would rather
not. Is there a way to modify the script to show the sender as
something besides "nobody"? Having something in the $from variable
doesn't seem to be enough.

This is just a guess, but based on the bounced message, I assume I
need to include the $from variable in the following fields that
currently say "nobody":

Return-path: no****@mydomain .com
Received: from no****@mydomain .com
(envelope-from <no****@mydomai n.com>)

Any ideas?

TIA,

Jason
Jason,

First thing you need to do is take that script offline. If spammers
find it you'll have about 15 minute before you're in every spam source
blacklist in the world. And a good hosting company will shut your site
down until you get it fixed.

Then get a secure contact form up there. I can't recommend any offhand
- I wrote my own and use it on various sites. But there are ones out
there. You could try hotscripts.com or see what others here recommend.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 28 '07 #4
"Jason" <jw*******@gmai l.comwrote in news:1175061293 .558023.29400
@n59g2000hsh.go oglegroups.com:
The problem is that when it emails out, the server recognizes it as
coming from "nobody," which is automatically bounced to me. I set the
server up to refuse "nobody" emails as a hack-attack preventative, but
it's usually not a problem... until now.
And to address your question (someone correct me if I'm wrong):

You are running php as an Apache module, correct?

I believe in this environment, Return-path is going to be the web-server's
username, unless you hack something in your mail server software (e.g.
sendmail). The other from headers you should be able to set within your
(more secure) script.

However, if you have php running as CGI then the Return-path will be set to
the username that php is running as.

I believe searching on "tectite" and mail and form will bring you to a
(relatively?) secure mailform script. Do NOT use "Matt's".

Apr 1 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1530
by: R. Gregg Reed | last post by:
I bought a script called WebDate and installed it on my server, where it worked fine. A week ago my hosting company installed phpsuexec, and now the mail function won't work. I keep getting errors like: ******************************************************** This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The...
1
5158
by: Giobibo | last post by:
Hi. I want to send mail with the function mail(). I am on a shared server in SAFE MODE. When I send a mail I get the message: "SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE" But I need the fifth parameter, because it is the only way to set my
8
2528
by: Askari | last post by:
(Help for Pygame module) Hi, How I can make a "fadeout text"(alpha at 255,254,253...0) on a surface and my surface's background must be transparatly? Note : I can do a fadeout but with a background on the surface's text but I wan't a tranparently background. Example (don't work) :
70
8858
by: Roy Yao | last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ? According to my analysis, operator sizeof, (type) and * have the same precedence, and they combine from right to left. Then this expression should equal to "sizeof( (int)(*p) )", but the compiler does NOT think so. Why? Can anyone help me? Thanks. Best regards. Roy
31
4840
by: Yeah | last post by:
Is it absolutely necessary to include "http://" in an A HREF hyperlink? Would it be wise to remove this from one's Links page, just to save code?
19
2567
by: hansBKK | last post by:
Upfront disclaimer - I am a relative newbie, just starting out learning about PHP, mostly by researching, installing and playing with different scripts. I am looking for a host that will provide the right environment for this - running a wide variety of PHP applications. I realise that security is also important, but for now flexibility is more important to me. Note that I'm **not** looking for people to recommend hosting companies, I...
4
2699
by: Fro | last post by:
Hi, the operating system (Unix) considers a php-server as a user with name "nobody". For example, if my php-script saves a file uploaded by a user, the owner of the file will be "nobody". I would like to know if "nobody" is considered as "group" or "others" (in terms of the "chmod" command)? In other words, is "chmod g+w dirname" sufficient to allow to "nobody" to write in the directory "dirname" or should I use "chmod o+w dirname"?
4
1407
by: Jeff | last post by:
I haven't used php to send mail yet and have some questions. I see that you can add headers, and these days it is essential to have a real "from". But I see you can also do this: mail('nobody@example.com', 'the subject', 'the message', null, '-fwebmaster@example.com');
4
11621
by: jamesnkk | last post by:
Hello, I am a newbie in Linux. My company have a tester machine installed with Suse 10 samba. I have set the IP address of the Linux machine to connect into the Windows 2003 server. So from my windows xp I could browse thru the machine and have set a share folder /tmp on the linux machine. Everything work perfect, the problem is that everytime the linux generate a new log file and save into the /tmp folder. From Windows XP, I cannot move the...
0
8142
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8589
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8287
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8443
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6093
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4136
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2573
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1438
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.