Re: [PHP] mail function from and reply to address problem
On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Substitute postfix or whatever as appropriate for your configuration. So you now have the joy of digging into sendmail configuration. Good luck! -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function from and reply to address problem
Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function from and reply to address problem
apache is definitely listed in the trusted users, as I mentioned, I can send from dozens of other domains, its just one specific domain that I can't. i'll let you know the results of sending the email from outside of php. On 7/12/07, Chris [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/
Re: [PHP] mail function from and reply to address problem
mail function returns 1(true) whether or not i'm sending to the new virtual host domain name or any random domain name. turns out sendmail function does the same thing, so it looks like it's a sendmail problem... but how is that possible if i've never configured anything for this new domain except for http virtual host config? hmm. On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: apache is definitely listed in the trusted users, as I mentioned, I can send from dozens of other domains, its just one specific domain that I can't. i'll let you know the results of sending the email from outside of php. On 7/12/07, Chris [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/
Re: [PHP] mail function from and reply to address problem
figured it out... the domain in question's dns is set to CNAME to the main domain on that server, whereas, the remaining domains are just using the A record with the IP. I changed one of the other domains to use the CNAME and it did the same thing. So looks like thats the culprit. I'll have to comb through the sendmail configuration and find out if I can reverse this behavior. On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: mail function returns 1(true) whether or not i'm sending to the new virtual host domain name or any random domain name. turns out sendmail function does the same thing, so it looks like it's a sendmail problem... but how is that possible if i've never configured anything for this new domain except for http virtual host config? hmm. On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: apache is definitely listed in the trusted users, as I mentioned, I can send from dozens of other domains, its just one specific domain that I can't. i'll let you know the results of sending the email from outside of php. On 7/12/07, Chris [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/
Re: [PHP] mail function from and reply to address problem
On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: figured it out... the domain in question's dns is set to CNAME to the main domain on that server, whereas, the remaining domains are just using the A record with the IP. I changed one of the other domains to use the CNAME and it did the same thing. So looks like thats the culprit. I'll have to comb through the sendmail configuration and find out if I can reverse this behavior. Sendmail has a usenet newsgroup (comp.mail.sendmail), where you might be able to find someone that can help you :) Tijnema On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: mail function returns 1(true) whether or not i'm sending to the new virtual host domain name or any random domain name. turns out sendmail function does the same thing, so it looks like it's a sendmail problem... but how is that possible if i've never configured anything for this new domain except for http virtual host config? hmm. On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: apache is definitely listed in the trusted users, as I mentioned, I can send from dozens of other domains, its just one specific domain that I can't. i'll let you know the results of sending the email from outside of php. On 7/12/07, Chris [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/ -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function from and reply to address problem
thanks, thats exactly where I went. looks like i'm on the right track. On 7/13/07, Tijnema [EMAIL PROTECTED] wrote: On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: figured it out... the domain in question's dns is set to CNAME to the main domain on that server, whereas, the remaining domains are just using the A record with the IP. I changed one of the other domains to use the CNAME and it did the same thing. So looks like thats the culprit. I'll have to comb through the sendmail configuration and find out if I can reverse this behavior. Sendmail has a usenet newsgroup (comp.mail.sendmail), where you might be able to find someone that can help you :) Tijnema On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: mail function returns 1(true) whether or not i'm sending to the new virtual host domain name or any random domain name. turns out sendmail function does the same thing, so it looks like it's a sendmail problem... but how is that possible if i've never configured anything for this new domain except for http virtual host config? hmm. On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: apache is definitely listed in the trusted users, as I mentioned, I can send from dozens of other domains, its just one specific domain that I can't. i'll let you know the results of sending the email from outside of php. On 7/12/07, Chris [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/ -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info
RE: [PHP] mail function from and reply to address problem
Sounds more like the mail server than PHP. Although weird anyway ! What mail server are you using : local/remote, smtp/sendmail/qmail ? Try using whatever method and send a mail through this server from outside of PHP with the same problem parameters ? Does that work ? It should either eliminate PHP, or point the finger ! I suspect eliminate but you never know.. That's where I think I'd start anyway. Send uz an update when you have some answers. Steve -Original Message- From: Tanner Postert [mailto:[EMAIL PROTECTED] Sent: 13 July 2007 00:33 To: php-general@lists.php.net Subject: [PHP] mail function from and reply to address problem I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? thanks in advance. Tanner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail function from and reply to address problem
I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? thanks in advance. Tanner