Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sendmail produces 550 error when sending to Comcast.net

Status
Not open for further replies.

etraderX11

Technical User
Mar 22, 2005
1
US
Hi everyone! I am not a Linux Pro, but I have some basic knowledge to get my way around it. I've spent all day trying to configure my Fedora 3 box to send/receive emails using sendmail. And everything seems to work with an exception when I try to send e-mail to my primary mailbox at comcast.net. I keep constantly getting error message from comcast SMTP:
550 [PERMFAIL] comcast.net requires valid sender domain

I also tried to configure KMail and it gave me the following result;

The original message was received at Wed, 23 Mar 2005 02:00:04 GMT
from localhost.localdomain [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<myemailaddress@comcast.net>
(reason: 550 [PERMFAIL] comcast.net requires valid sender domain)

----- Transcript of session follows -----
... while talking to gateway-r.comcast.net.:
>>> DATA
<<< 550 [PERMFAIL] comcast.net requires valid sender domain
550 5.1.1 <myemailaddress@comcast.net>... User unknown
<<< 503 need RCPT command [data]

Apparently the problem is in me trying to send the e-mail from localhost.localdomain wich is not known to comcasst DNS.
When I try to TELNET smtp.comcast.net on port 25 everything goes well and I am able to send an e-mail, but for some reason sendmail just hangs up doing it. I tried to reconfigure sendmail.mc and rebuild sendmail.cf with multiple other options in order to find out where the missing domain name is comming from, but everything was useless. I even reconfigured my Firewall for ports 20, 21 and 25 and disabled SELinux, but again results were the same. I saw lots of people on the web had the same problem with comcast.net using sendmail, but none of them was successfull in explaining if they could fix the problem and more importantly - how. I googled around for hours trying to find the answer, but again no luck there.

The problem is that if I send an e-mail using KMail, it doesn't let me specify the reply e-mail, and it defaults to the current user on the machine, such as root@localhost.localdomain. But also when I tried to send a mail using php mail() function, where I can specify a From: header it still gives me the same error() and returns the bad mail to apache@localhost.localdomain
I can send e-mail to ...@comcast.net using Mozilla mail where I can specify who to send e-mail from and then it sends just fine.
But how can I perform mail() function in PHP? I tried:

<?php

$to = 'myemailaddress@comcast.net';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@someknowndomain.com';

$formsent = mail($to, $subject, $message, $headers);
?>

-That's when I got the bad mail to apache@localhost.localdomain

If you have any idea of how to change it please type me a reply and I'll appreciate it very much.
Thank you.
George.

 
This is more of a PHP question than a sendmail question.

Use the 5th parameter to the mail() function to specify the "real" from address.
Code:
<?php

$to      = 'myemailaddress@comcast.net';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@someknowndomain.com';
$realfrom = '-f webmaster@someknowndomain.com';

$formsent = mail($to, $subject, $message, $headers, $realfrom);
?>
This should do what you want.

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top