sendmail not working

tonelm54
tonelm54 used Ask the Experts™
on
Good afternoon,
I have been trying to setup sendmail to work with PHP, but cannot seem to get it working correctly.

What Im trying to do is configure sendmail to relay all emails through another SMTP server on my network, I have downloaded and installed sendmail correctly (I belive), and configured it to send mail through my SMTP server, however when I try and do the command at the terminal "sendmail test@mydomain.com" I get no error, but in my mailbox (on the server) I get:-

The original message was received at Tue, 17 May 2011 15:33:37 +0100
from localhost [127.0.0.1]

   ----- The following addresses had permanent fatal errors -----
<email@tonycross.me.uk>
    (reason: 550 Host unknown)

   ----- Transcript of session follows -----
550 5.1.2 <email@tonycross.me.uk>... Host unknown (Name server: 192.168.2.25: host
not found)

Open in new window


If I try and telnet to 192.168.2.25 on port 25 from the server, everything responds correctly.

What Im trying to do is get sendmail working at the command line at first, then fugure out why my php.ini doesnt work.

Im not really sure what I can upload to get any help with this, obviously its my onfiguration thats the issue, but not sure where the configuration file is to email you.

Any help would be appriciated.

Thank you
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

The problem is that sendmail need to resolve the FQDN so you need at least to put in your /etc/hosts files the line to resolv the ip

edit your /etc/hosts and add the following line

192.168.2.25 mail.mydomain.com

where mail.mydomain.com is the hostname of your server

Commented:
If I read correctly,
Sounds like when you send a new email, it goes out (from @localhost)
But it refuses to relay emails from other domains (from @yourdomain.com)

If I read right, maybe you should check the relaying rules in your sendmail?
Allow relaying all domains.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial