Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to diagnose why email won't send from a new RHEL v5.8 server. Sendmail is up and running, but everything is stuck in the queue (confirmed with mailq) with connection timed out errors.

If I have the hostname of the server to:

natulwebserver01.bto.com

But try to send emails with PHP and set the 'from' email address to:

no-reply@dataportal.com

...this would cause the destination mail servers to block the emails right?

If so, does that mean the email address I set as a 'from' address in the PHP mail() function would have to match the server hostname exactly? For example:

no-reply@natulwebserver01.bto.com

I have tried that and it doesn't work, but I want to ask just to confirm in theory.

Also - and maybe this is the real cause - does the hostname need to resolve to the IP address of the server in the destination mailserver's DNS before it will accept emails from it?

For example:

natulwebserver01.bto.com

...is an internally meaningful hostname, but it is not a publicly registered domain name. i.e. if you ping natulwebserver01.bto.com it will not return the IP address of the server.

Does it make sense that the destination mailservers would block email from my server as it is reporting a hostname that cannot be verified with DNS?

*I have modified the actual hostnames/domains involved for the purposes of this question.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The domain in the 'From' address need not be the same as the hostname of the smtp server, but the hostname should be publicly registered and match reverse DNS of the IP on which sendmail is running.

share|improve this answer
    
Thank you Tatul. Is it the full subdomain that needs to be registered, like 'natulwebserver01.bto.com', or just 'bto.com' would be enough for the validation? –  dabayl Apr 23 '12 at 17:01
    
You'll want to add an MX record for the subdomain, I believe. –  JohnThePro Apr 23 '12 at 17:06
    
Ok I tried it and it worked without the full 'natulwebserver01.bto.com' hostname needing to be registered - just the 'bto.com' was enough. –  dabayl Apr 23 '12 at 17:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.