1825768 Members
2070 Online
109687 Solutions
New Discussion

sendmail Problem

 
Chris Frangandonis
Regular Advisor

sendmail Problem

Hi All,

I have a small problem with sendmail, here goes:

I have changed $Dj$w.????.co.za in sendmail.cf , and in the nsswitch.conf have added
The following :
hosts: files[NOTFOUND=return UNAVAIL=continue]
protocols: files[NOTFOUND=return UNAVAIL=continue]
services: files[NOTFOUND=return UNAVAIL=continue]
networks: files[NOTFOUND=return UNAVAIL=continue]
netgroup: files[NOTFOUND=return UNAVAIL=continue]
rpc: files[NOTFOUND=return UNAVAIL=continue].
In my resolve.conf I added domain ????.co.za. in my /etc/hosts file I added
??:??:??:?? ????.co.za # and comment.

When I ??? echo cat | sendmail ???v (my email address) the following occurs:

(My email address)... Connecting to (companies mail server). via esmtp...
(My email address)... Deferred: Connection reset by (companies mail server).
Closing connection to (companies mail server).

Where did I go wrong?

Many Thanks
Chris

12 REPLIES 12
Sanjay_6
Honored Contributor

Re: sendmail Problem

Hi Chris,

Modify your /etc/mail/sendmail.cf file and check this entries,

Dj$w.your_domain.com

DS your_mail_relay

Now make sure the system is able to resolve the mail relay name either through the hosts file or through DNS, restart sendmail,

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

Then try and see if you are able to send emails from this server.

Hope this helps.

Regds
Chris Frangandonis
Regular Advisor

Re: sendmail Problem

Hi Sanjay

I have changed the following in sendmail.cf

Added a # infront Cwlocalhost and replaced it with Cw{node name},
changed #Dj$w.Foo.COM and replaced it with Dj$w. ?????.co.za,
changed DS to Dsmail.?????.co.za, and #DLname_of_luser_relay to Dmail.????.co.za
and hash out DR, added DRmail.?????.co.za
then did
/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

then ran
echo cat | sendmail. ???v my_email_address and problem still occuring.


Thanks
Chris
someone_4
Honored Contributor

Re: sendmail Problem

Hi
Try making your line in your
nsswitch.conf look like this.

hosts: files [NOTFOUND=continue TRYAGAIN=continue] dns

then do an nslookup on your domain.

nslookup your_domain

and if that works try to send the email again.

Post your results.

Thanks

~ Richard
Sanjay_6
Honored Contributor

Re: sendmail Problem

Hi,

Is your mail server accepting emails for the email address you are trying to send email to. In our configuration we submit mails to a mail relay which in turns forwards them to the mail servers.

Moreover we are not using Cwhostname, DLname_of_luser_relay or DRmail.?????.co.za variable in the sendmail.cf file.

Hope this helps.

Regds
Chris Frangandonis
Regular Advisor

Re: sendmail Problem

Hi Richard

Thanks.
Did change nsswitch.conf and ran nslookup ????.co.za

# nslookup ????.co.za
Using /etc/hosts on: hs-a5c1

looking up FILES
Name: ?????.co.za
Address: ???.???.???.???

Results

# echo cat | sendmail -v frangac@telkom.co.za
my_email_adress... Deferred: Name server: ?????.co.za.: host name lookup failure
In my /etc/hosts file the entry is
???.???.???.??? ??????.co.za # mail server
so why host name failure?

Chris
Chris Frangandonis
Regular Advisor

Re: sendmail Problem

Hi Sanjay

On the one machine (10.20) , sendmail was setup as explained above and worked. With this machine (11.00 ) , I did the same setup, with deffered problems.

Chris
someone_4
Honored Contributor

Re: sendmail Problem

hi
try this for me
in nsswitch.conf
change your hosts line to look like so

hosts: files

save the change.
Do an nslookup and try to send the email again..

Let us know what your results are.

~ Richard
Chris Frangandonis
Regular Advisor

Re: sendmail Problem

Hi Richard

Done. Results:
# nslookup ????.co.za
Using /etc/hosts on: hs-a5c1

looking up FILES
Name: ??????.co.za
Address: ???.???.???.???

# echo cat | sendmail -v my_email_address
my_email_address... Connecting to ???????.co.za. via esmtp...
my_email_address... Deferred: Connection reset by ?????.co.za.
Closing connection to ?????.co.za.

Chris
someone_4
Honored Contributor

Re: sendmail Problem

can you go to
???????.co.za

and make sure that the /etc/hosts file has an entry for hs-a5c1.

And then try again.
I am thinking that will get you going there.

~ Richard
Arockia Jegan
Trusted Contributor

Re: sendmail Problem

I guess this system is behind the firewall. Can you run the following command on your HP system?

#telnet 25

and post the output.

If it says

telnet: Unable to connect to remote host: Connection refused

You system is behind the firewall and the port number 25 is not opened.
John Dvorchak
Honored Contributor

Re: sendmail Problem

Chris, I think that you will find that the mods you are making to /etc/sendmail.cf :
$Dj$w.????.co.za
etc.
Only affect normal users not root. When root sends an email, sendmail gets it's own name from the /etc/hosts file. So your /etc/hosts file better resolve your IP address to something that the Sendmail relay server likes. The corporate sendmail relay server has to be able to resolve the name you have in the header of all emails. Be sure and look at the messages in /var/adm/syslog/mail.log and that should point you right to the problem. Most of the time it is a problem with the way your local server resolves it's own name. If you can't change that then try the email test logged as a normal user and see what happens. Normal users will us the $Dj$w.????.co.za ONLY if it can't resolve it's own FQDN (Fully Qualified Domain Name). You may have to alias the host name, also in /etc/sendmail.cf but I don't remember where or what the variable is.
Good luck
If it has wheels or a skirt, you can't afford it.
Chris Frangandonis
Regular Advisor

Re: sendmail Problem

Hi All,

Thanks for your input. The problem was that my ip was not configured on the mail server.

Thanks Once again
Chris