OK lets start from the top:
fix the hosts file. the one you posted earlier in the thread has a problem. host entries should always be:
ADDRESS NAME NAME NAME etc...
I see the last entry as:
NAME ADDRESS NAME NAME etc.
make sure for your first 127.0.0.1 it is:
127.0.0.1 HOSTNAME.DOMAIN.TLD HOSTNAME localhost localhost.localdomain localhost4 localhost4.localdomain4
where hostname.domain.tld matches your fully qualified "hostname" and hostname on it's own is without the domain part.
The order above is important.
Unless you are using ipv6 remove or comment out the rest of the chuff for now. You can probably get away with just the one line above.
Code:
Hint, both these commands below should match:
hostname
hostname -f
Next, make sure your resolv.conf is correct.
/etc/resolv.conf should contain at minimum:
Code:
search DOMAIN.TLD
nameserver dns1IP
Next you need to decide if your server is going to mail directly, or if you will use a smarthost/relay to deliver for you. The biggest driving factor is what your ISP will allow. In effort to prevent compromised home computers from becoming spam servers, many ISPs block outbound smtp on port 25 to the world except to their provided SMTP server (which usually requires authentication)
Mailing directly will require some sort of valid source (from) e-mail address that the receiving mail server can verify. Many anti-spam routines will dump e-mail to the floor if the "sender" server of XYZ.com does not match the SPF record of valid senders.
eg: if you send from your server using address:
[email protected], the receiving server will check the SPF DNS record for here.com to see if your IP/host is in the list of valid senders.
This check will happen also with a smart-relay, so you will likely need to use a from email address with no or at least a loose SPF record.
If you are using an smarthost, you will likely have an email with that ISP you can use that is properly configured to send.
Gone are the days of "blind trust" with e-mail.
Once that decision is made, then the sendmail.cf file needs configuring.
(this was basically my purpose for asking you to send me the details via PM. without knowing to: from: and smarthosts it was getting difficult to troubleshoot generically)