Operating System - HP-UX
1832620 Members
2503 Online
110043 Solutions
New Discussion

Re: mailing out from our server ...

 
dave broome_1
Advisor

mailing out from our server ...

Server D_370
O/S HP/UX 10.20
We are using hosts file connection and have disable DNS capabilities on our application server. Users log on fine and it suits our needs to a point. The problem we are having is mailing anything out to anyone from that server. We have put the ip address and name in the hosts file for our SMTP gateway. We can successfully ping using that name or ip address but still it fails to mail out when using ELM. We need to know where/how to configure the "mailto" on the server, essentially how does ELM or any mail tool know where it's destination of the message is? How does it translate name@place.com to reach it's desired SMTP server and then intended recipient.

As always any help is much appreciated.

Dave Broome
24 REPLIES 24
T G Manikandan
Honored Contributor

Re: mailing out from our server ...

All the configuration info is there at /etc/mail/sendmail.cf file.

To point to a smtp sever you should append to the

DS entry in the file,like

DSmailserver.com

Also make sure that it not only pings to that machine but also does a proper nslookup of that server.

REvert
Matthew Mallard
Occasional Advisor

Re: mailing out from our server ...

Hi Dave,

To be honest I'm not sure exactly how you are trying to achieve your mail out solution, but a possible way is to set up your D as a mail server and get it to handle the mail for you.

If this is a good idea for you then enable senmail, make /etc/rc.config.d/mailservs look like this:
export SENDMAIL_SERVER=1
export SENDMAIL_SERVER_NAME=

edit /etc/mail/sendmail.cf and set the DS macro to your SMTP gateway.

run '/sbin/init.d/sendmail start'

have a look at /var/adm/syslog/mail.log as you send some emails (just do it from the command line using mailx until it is sorted)

Hope that helps a little
dave broome_1
Advisor

Re: mailing out from our server ...

thank you both for your help. We changed the sendmail.cf file and added our SMTP gateway to the DS entry so our cf file now looks like ...
DS

The mail.log file suggests that the gateways is being used but still fails with the message


Feb 7 11:56:12 bas_d370 sendmail[18867]: LAA18866: to=robert.sebastian@uk.delarue.com, ctladdr=root (0/3), delay=00:00:00, xdelay=00:00:00, mailer=relay, relay=basim012.uk.delarue.com, stat=Deferred: Name server: .uk.delarue.com: host name lookup failure

I have not included our SMTP gateway name in this message for security reasons.

We have successfully performed an nslookup on the smtp server from a UNIX prompt.

Any more help will be gratefully received.

Dave
Matthew Mallard
Occasional Advisor

Re: mailing out from our server ...

Isn't the relay in the mail log your SMTP gateway? I would expect the mail log to be something like this:

Feb 7 11:56:12 bas_d370 sendmail[18867]: LAA18866: to=robert.sebastian@uk.delarue.com, ctladdr=root (0/3), delay=00:00:00, xdelay=00:00:00, mailer=relay, relay=basim012.uk.delarue.com. [10.0.0.1], stat=Sent (LAA18866 Message accepted for delivery)

are you sure an nslookup of basim012.uk.delarue.com works. By virtue of that fact the name lookup does not work you have a name resolution issue. I put a ficticious DS entry in my sendmail.cf only to get the same error as you.

Can you post the nslookup output?
T G Manikandan
Honored Contributor

Re: mailing out from our server ...

If you have disabled the DNS then

you should have proper entries in the /etc/hosts file.

Like

ip-add basim012.uk.delarue.com basim012

ALso make sure that the order of the /etc/nsswitch.conf file should have files first like

hosts: files

Also make sure that /etc/resolv.conf file does not exist.

Thanks
dave broome_1
Advisor

Re: mailing out from our server ...

thanks again.
We have checked the files you suggested and they look fine. You are right the relay is the smtp (so much for trying to be secure) Below is the output from the nslookup
root: nslookup basim012.uk.delarue.com
Using /etc/hosts on: bas_d370

Name: basim012.uk.delarue.com
Address: nn.n.n.nnn
Aliases: basim012

In another attempt to be secure I have taken out the ip address. But as you can see it seems to resolve the name ok.

Any idea??
Matthew Mallard
Occasional Advisor

Re: mailing out from our server ...

Not sure this will help, but worth looking at.

Enable the TryNullMXList option in sendmail.cf (ie uncomment #O TryNullMXList). This should be enabled if you are not using MX records (which you are not - you need DNS for that).

The other thing to try is to telnet to the SMTP port on the SMTP host - telnet smtphost 25 and see if you can have a conversation.
dave broome_1
Advisor

Re: mailing out from our server ...

I have now tried a number of things. Anything I seem to put in the sendmail.cf file still ends up as a host name look-up failure in the mail.log even though I can ping any one of the names it's seems unable to resolve through mail. I tried the last suggestion which was to uncomment the xtrynullmxlist option but still no joy. I think what I may need a step-by-step of setting up/using sendmail with a hosts file. Anyone know a good one?
Plus I have 100's of deferred mails now in ELm that keep retrying and filling up my mail.log. How do I get rid of these (the mails not the entries in the log file)??

Any help is appreciated.
BFA6
Respected Contributor

Re: mailing out from our server ...

Hi Dave,

check your /etc/nsswitch.conf file, it should contain the following

hosts: files
services: files
protocols: files
networks: files
rpc: files
netgroup: files

Regards,

Hilary
dave broome_1
Advisor

Re: mailing out from our server ...

my nsswitch.conf looks like this ...

hosts: dns [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=return] nis [NOTFOUND=co
ntinue UNAVAIL=continue TRYAGAIN=continue] files


which looks quite different to what you suggest, should I rename this one to .old and create a new one with the text that you suggested???
dave broome_1
Advisor

Re: mailing out from our server ...

in fact we just tried it. We created a new nsswitch.conf file with all of the settings that you suggested, re-tried the mail and it failed with the same message "host name look-up failure"

anything else to try??
BFA6
Respected Contributor

Re: mailing out from our server ...

Hi Dave,

If you are not using dns, then I would give it a go.

When I was trying to set up mail I didn't have an nsswitch.conf and in the mail queue kept getting the following

(host map: lookup (domainname.co.uk): deferred)

Regards,

Hilary
dave broome_1
Advisor

Re: mailing out from our server ...

Hilary,

Thanks for that, as mentioned before we did give it a go and got the same message, which is ..
basim012.uk.delarue.com: host
name lookup failure
BFA6
Respected Contributor

Re: mailing out from our server ...

Hi Dave,

this is the process I went through to enable mail - it may help (it may not)

added into /etc/hosts

modified /etc/nsswitch.conf as previous message.
modified /etc/mail/service.swict to read
hosts files
aliases files

modified /etc/mail/sendmail.cw to contain the hostname
localhost


modified /etc/mail/sendmail.cf
# Smart relay host
DS

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

Hope this helps.

Hilary
dave broome_1
Advisor

Re: mailing out from our server ...

thanks I will re-trace my steps.
Jose Mosquera
Honored Contributor

Re: mailing out from our server ...

Hi,

Pls ensure that your relay server name (DS) definition in your /etc/mail/sendmail.cf is reachable at least from your /etc/host file, i.e:
DSmyrealy

ping myrelay
PING name.xxxx.xx.xxxx.xxx: 64 byte packets
64 bytes from n.n.n.n: icmp_seq=0. time=1. ms
64 bytes from 2.34.1.48: icmp_seq=1. time=0. ms
----name.xxxx.xx.xxxx.xxx PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/1

About /etc/nsswitch.conf file, this file decribe the resolution name order, around DNS, NIS or host file service, if you aren't use NIS pls omit this service and try again defining just the DNS and hosts services as follow:

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

Also restart your sendmail service **always** any change have been done:
/usr/sbin/sendmail stop
/usr/sbin/sendmail start

Rgds.
dave broome_1
Advisor

Re: mailing out from our server ...

Jose,

thanks. This is the frustrating part. I can ping the mailserver and this is the entry in the sendmail.cf file. Not sure what should be in the sendmail.cw file ???
BFA6
Respected Contributor

Re: mailing out from our server ...

Dave,

sendmail.cw contains all the names the host could be known as, eg
localhost
fred
fred.com

Have you also checked /etc/mail/service.switch, so that it resolves usinf /etc/hosts

# This means that hostnames will be resolved by referencing /etc/hosts
# and aliases will be resolved by referencing /etc/mail/aliases.
##

hosts files
aliases files

It is frustrating - I usually never remember from one box to the other what I did to fix it !

Regards,

Hilary
dave broome_1
Advisor

Re: mailing out from our server ...

A re-cap.
I have checked my service.switch it looks like this ...
hosts files
aliases files

My sendmail.cw file contains all references that the host is known as.

The 2 changes I have made to sendmail.cf are ..
1. adding the mail host to Smart relay host
DSmailhost
2. uncomment O TryNullMXList

3. Made sure that mailhost is included in /etc/hosts file

4. Checked that the first entry in /etc/hosts is the fully qualified name of the host.

Again I can ping the mailhost, I can't telnet to it because connection is refused. But when I send a mail out using elm I don't receive the mail and I get Name server: mailhost "hostname lookup failure".
What do I have to do to get this damn thing to work??? Plus I have a load of test mails now deferred that are frequently trying and failing to mail out. I have to trim my mail.log every day because it gets so many failure entries. How do I delete these mails ??

I appreciate all the help, I am sure there is just one setting that is stopping this working but I am getting quite frustrated finding it, as you can imagine.
Dave
BFA6
Respected Contributor

Re: mailing out from our server ...

Hi Dave,

To remove mails in the mail queue, I remove the files from /usr/spool/mqueue

Once these have been deleted, mailq shows an empty mail queue.

Just one thing - after making the changes did you stop & restart sendmail ?

Presumabely if you just use mail, you get the same hostname lookup problems?

Hilary
U.SivaKumar_2
Honored Contributor

Re: mailing out from our server ...

Hi,

Keep DS setting nsswitch.conf untouched as of now.

Edit sendmail.cf , there will be a line like this.

O DaemonPortOptions=Port=smtp,Addr=xxx.xxx.xxx.xxx, Name=MTA,M=c

Change M=c to M=C in the above line to turn off canonfication.

Like this.

O DaemonPortOptions=Port=smtp,Addr=xxx.xxx.xxx.xxx, Name=MTA,M=C

Restart sendmail daemon.

Hope your problem is solved.

regards,

U.SivaKumar





Innovations are made when conventions are broken
dave broome_1
Advisor

Re: mailing out from our server ...

Hilary,

Thanks for help. We have finally resolved the problem. For reference, the problem was the service.switch was located in /etc/mail when it was expecting it to be in /etc. We created a link in /etc to the file and bingo!! mail now can be sent. Thank you all for your help, it is much appreciated.
BFA6
Respected Contributor

Re: mailing out from our server ...

Hi Dave,

Glad it's all fixed - was beginning to tear my hair out :-)

Hilary
dave broome_1
Advisor

Re: mailing out from our server ...

me too.

thanks again.