Page 1 of 1

Change "from nobody" to a real address

Posted: Sat May 02, 2009 6:21 pm
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.

Does anyone know or is $20 required for answers?

Posted: Wed May 06, 2009 5:18 am
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.

Posted: Wed May 06, 2009 8:50 am
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"); 

That one does not work

Posted: Wed May 06, 2009 3:21 pm
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.

Posted: Wed May 06, 2009 7:49 pm
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");

Thanks very much

Posted: Wed May 06, 2009 8:27 pm
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!

Posted: Thu May 07, 2009 5:42 pm
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);

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

Posted: Thu May 07, 2009 9:01 pm
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!

Posted: Thu May 07, 2009 11:33 pm
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

Thanks DC

Posted: Fri May 08, 2009 12:51 am
by cramblit
That one (Return-Path) unfortunately doesn't appear to accept this change.

Tried it. No change. Still "nobody".

Posted: Fri May 08, 2009 2:46 am
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

Posted: Fri May 08, 2009 7:38 am
by Klemen
Try "Return-path" where "path" starts with a lowercase "P"

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

Posted: Fri May 08, 2009 3:08 pm
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"

Posted: Fri May 08, 2009 3:24 pm
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

You missed that in my post

Posted: Fri May 08, 2009 3:27 pm
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!