LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-28-2003, 07:09 AM   #1
dddlc
LQ Newbie
 
Registered: Jan 2002
Location: AU
Distribution: RedHat 8.0
Posts: 8

Rep: Reputation: 0
Apache, PHP or SendMail problem ??


I am currently trialing 2 LAMP CMS systems (Xoops & e-Xoops) & am having the same problem with both, in terms of outbound e-mail from Apache.

When a new user is registered, the CMS sends an e-mail to the address nominated by the new user with activation instructions.

The problem is that when the CMS sends the message, it goes out through Sendmail as apache@machine_name.my_domain_name rather than apache@my_domain_name. When the outbound mail hits most ISP's, they reject the message with a "553 Domain of sender address apache@machine_name.my_domain.com does not exist" because it fails RDNS tests.

Normal mail is being sent & received ok when I use a network POP3/IMAP client. The problem is only occuring when the webserver sends mail via a PHP mail() function.

A sample of my maillog entry is as follows;

Apr 28 19:48:38 machine_name sendmail[9142]: h3S9mb6s009142: to=user@isp_name.com, ctladdr=apache (48/48), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30268, relay=localhost.localdomain. [127.0.0.1], dsn=2.0.0, stat=Sent (h3S9mbKZ009144 Message accepted for delivery)

Apr 28 19:48:39 machine_name sendmail[9146]: h3S9mbKZ009144: to=<user@isp_name.com>, ctladdr=<apache@machine_name.my_domain.com> (48/48), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=30463, relay=mail.isp_name.com. [nnn.nnn.nnn.nnn], dsn=5.6.0, stat=Data format error


I have subsituted the actual details with fake details in italics

Any ideas of where the problem lies - is it Apache, PHP or Sendmail that is generating the incorrect e-mail address.

Last edited by dddlc; 04-28-2003 at 07:12 AM.
 
Old 04-28-2003, 07:28 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
It sounds to me like you need to actively specify a "from" address in the PHP that is generating the mail. Taken from http://www.php.net/manual/en/function.mail.php
Code:
mail("nobody@example.com", "the subject", $message,
     "From: webmaster@$SERVER_NAME\r\n"
    ."Reply-To: webmaster@$SERVER_NAME\r\n"
    ."X-Mailer: PHP/" . phpversion());
HTH

Jamie...
 
Old 04-28-2003, 08:11 AM   #3
dddlc
LQ Newbie
 
Registered: Jan 2002
Location: AU
Distribution: RedHat 8.0
Posts: 8

Original Poster
Rep: Reputation: 0
James,

Thanks for the reply, but I found the problem. I had to setup both MASQUERADE_AS(my_domain.com) and FEATURE(`masquerade_envelope') in my sendmail.mc & re-do sendmail.cf

I thought that I had done this, but must have forgotten. Mail from the webserver now goes out as apache@my_domain.com

David.

Last edited by dddlc; 04-28-2003 at 05:14 PM.
 
Old 04-28-2003, 08:13 AM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
Glad you got it working!

Jamie...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with sendmail and php nshoboul Linux - Software 0 12-19-2003 09:06 AM
Apache php index.php problem neurotic Linux - Software 3 11-18-2003 07:02 PM
sendmail - PHP problem munkus Linux - General 0 02-22-2003 06:55 PM
chrooting apache with php support - sendmail problems markus1982 Linux - Security 9 01-29-2003 06:13 AM
sendmail, apache and PHP help? ifm Linux - Software 2 06-21-2002 08:23 PM


All times are GMT -5. The time now is 10:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration