Change "from nobody" to a real address

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
cramblit
Posts: 8
Joined: Sat May 02, 2009 5:05 pm

Change "from nobody" to a real address

Post by cramblit »

Script URL: www.foreveraftersoaps.com (in iframe)
Version of script: 1.6
Hosting company: Mine
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: nobody and from nobody

Write your message below:

I'd just like to know how (& row) to insert a FIXED from address in gbook.php

The from "nobody" is a problem.

Really could not find anything that appeared to correspond with my file structure.

Thanks very much! Great script.
Joe
cramblit
Posts: 8
Joined: Sat May 02, 2009 5:05 pm

Does anyone know or is $20 required for answers?

Post by cramblit »

If I've done something wrong in my post ... please let me know.

Really not trying to be a smart ass. I just don't know.

I DID SEARCH. There simply was no answer ... the "ini" thing with the FROM address I did find did not work.
Joe
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Nothing wrong as far I am concerned, but keep in mind these are free scripts and free support so it can take a while to get a reply.

Try adding something like this on top of your settings file (open in Notepad and add this just below <?php ):

Code: Select all

ini_set ("sendmail_from","you@domain.com"); 
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
cramblit
Posts: 8
Joined: Sat May 02, 2009 5:05 pm

That one does not work

Post by cramblit »

First of all Klemen thanks very much for the help. I'll be paying for a few licenses over time.

That ini_set line has no effect. I had tried that before.

I had hoped that you could tell me the line and code within gbook.php I could edit and set a permanent from address for the admin emails.

I'm obviously not a PHP expert but I can edit code.

Thanks again.
Joe
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

You wrote you host the website yourself, so you do have access to the php.ini file? If yes try editing the php.ini file (open in Notepad) - modify line that starts with "sendmail_from"

Alternatively you can try changing this code in gbook.php:

Code: Select all

mail("$settings[admin_email]",$lang['t41'],$message);
to something like

Code: Select all

mail("$settings[admin_email]",$lang['t41'],$message,"From: you@yourdomain.com");
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
cramblit
Posts: 8
Joined: Sat May 02, 2009 5:05 pm

Thanks very much

Post by cramblit »

I misspoke on the hosting. I have a dedicated server with a hosting firm. I can get changes made but cannot make them myself.

I used your code and it worked. I am not sure if it really will do a lot of good with the spam filters since the reply-to and source from are still from nobody. But, I'll have to fix that in the php.ini file.

Thanks again!
Joe
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

You can add additional headers to the mail code, try like this:

Code: Select all

$headers = "From: you@yourdomain.com\n";
$headers .= "Reply-to: you@yourdomain.com\n";
$headers .= "Source: you@yourdomain.com\n";

mail("$settings[admin_email]",$lang['t41'],$message,$headers);
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
cramblit
Posts: 8
Joined: Sat May 02, 2009 5:05 pm

I did buy you a beer ... hopefully a few beers with $20US

Post by cramblit »

Thanks for you help. The headers helped a lot!

Still the Return-Path is nobody. I tried to change that one with an added line in your code but no luck. Think I'm stuck with that one.

My server tech support people say it's actually a bug in php4. If I have the guts to upgrade to php 5 it will fix the issue.

I am running several php/sql shopping carts and worry about possible problems with php5

I'll live with it.

Thanks again!
Joe
DC
Posts: 138
Joined: Sun Dec 09, 2007 9:28 am

Post by DC »

Yup that one is very important with a lot of providers AOL is one, try adding.

$headers .= "Return-Path: you@yourdomain.com\n";
IMPORTANT: it must be a valid email or many will regect it ...

DC
To Code Or Not To Code That Is The Question?

Was my post of any help to you? if so please do [url=http://www.clickcraft.net/slice_donations.php][b]Buy Me A Slice[/b][/url] ...
cramblit
Posts: 8
Joined: Sat May 02, 2009 5:05 pm

Thanks DC

Post by cramblit »

That one (Return-Path) unfortunately doesn't appear to accept this change.

Tried it. No change. Still "nobody".
Joe
DC
Posts: 138
Joined: Sun Dec 09, 2007 9:28 am

Post by DC »

I have only seen that problem on a few servers where it wouldn't accept the change ... it might be blocked then.

DC
To Code Or Not To Code That Is The Question?

Was my post of any help to you? if so please do [url=http://www.clickcraft.net/slice_donations.php][b]Buy Me A Slice[/b][/url] ...
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Try "Return-path" where "path" starts with a lowercase "P"
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
cramblit
Posts: 8
Joined: Sat May 02, 2009 5:05 pm

Replace FROM: NOBODY for emails to ADMIN (Solved!)

Post by cramblit »

Thanks Klemen ... Thanks DC

Not that I know what I'm doing but I got this exactly where I wanted. It even passed GMAIL's SPF check. You should, of course, actually set up the FROM ADDRESS USED on your server. I also installed an SPF record for this particular domain.

Code: Select all

$headers .= "From: guestbook@yourdomain.com\n";
$headers .= "Reply-to: guestbook@yourdomain.com\n";
$headers .= "Source: guestbook@yourdomain.com\n";

mail("$settings[admin_email]",$lang['t41'],$message,$headers, " -f guestbook@yourdomain.com");}
==== SOLUTION FOR SERVER NOT ACCEPTING CHANGED RETURN PATH====

http://www.geekology.co.za/blog/2009/02 ... -php-mail/

If this happens, some email servers will not accept the message because the Return-Path domain can’t be verified. To force the correct Return-Path use the mail() function’s fifth argument to specify extra options that must be passed to sendmail:

mail('recipient@domain.com', 'Subject',
$mail_body, $headers, " -f sender@domain.com");


This changes the Return-Path "-f sender@domain.com"
Joe
DC
Posts: 138
Joined: Sun Dec 09, 2007 9:28 am

Post by DC »

Remember this must be changed to a valid email address or it will not verify.

mail('recipient@domain.com', 'Subject',
$mail_body, $headers, " -f sender@domain.com");

thismustbvalid@domainyouhavesetup.com

Same with Return-Path:

Must be valid cant use a fake address just making sure you did that.

DC
To Code Or Not To Code That Is The Question?

Was my post of any help to you? if so please do [url=http://www.clickcraft.net/slice_donations.php][b]Buy Me A Slice[/b][/url] ...
cramblit
Posts: 8
Joined: Sat May 02, 2009 5:05 pm

You missed that in my post

Post by cramblit »

You should, of course, actually set up the FROM ADDRESS USED on your server. I also installed an SPF record for this particular domain.

The email address I used is valid.

Thanks!
Joe
Post Reply